A set of reusable GitHub actions that can be used to simplify your workflows.
If you use any action that works on git history (such as changelog, jira tickets etc.), you MUST enable deep checkout in your checkout action, otherwise you will get cryptic git errors:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
with:
fetch-depth: 0Setup java and enable dependency caching for gradle projects.
Example usage:
- uses: inovait/actions-common/gradle-setup@008393739c282052a3d3e02963f0ce92b4703366 #v19
with:
java-version: 17Setup java, Android SDK and enable dependency caching.
Example usage:
- uses: inovait/actions-common/android-setup@008393739c282052a3d3e02963f0ce92b4703366 #v19
with:
java-version: 17Start Android emulator and run specified command when emulator is active. When your command finishes, emulator is stopped.
For now, this action always starts API 30 ADT emulator image. We can add multiple emulator types later, if needed.
Example usage:
- name: Run Android Emulator tests
uses: inovait/actions-common/android-run-with-emulator@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
command: './gradlew connectedAndroidTest'(See changelog's README.MD for more info)
Action will generate Markdown changelog from list of commits.
Example usage:
- name: Generate Changelog
uses: inovait/actions-common/git-changelog-generator@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
from: efe8dc92136a28e3f9ace97e7af9ae456fd9e2d0
to: e31a0104ee0f9831e061a62c555c9db211885b1f
git_commit_url_prefix: 'https://github.com/inovait/actions-common/commit/'
jira_url: 'https://inova-it.atlassian.net/'
target_file: "CHANGELOG.MD"Action will generate Markdown changelog from all commits made since the last successful Workflow on this branch.
Action behaves identically to the above changelog action, except that you do not pass from and to inputs.
Example usage:
- name: Generate Changelog
uses: inovait/actions-common/changelog-since-last-build@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
git_commit_url_prefix: 'https://github.com/inovait/actions-common/commit/'
jira_url: 'https://inova-it.atlassian.net/'
target_file: "CHANGELOG.MD"Action is used to publish files to Spotlight.
Example usage:
- name: Publish to spotlight
uses: inovait/actions-common/spotlight-publish@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
api_key: '...'
destination: 'release'
version: "1.2.3"
track: "Develop"
files: |
build/output/**/*.apk
CHANGELOG.MDArguments:
api_key- your API key for Spotlight, ideally stored in Action Secretsdestination- Eitherworkspace(publish files to Spotlight workspace) orrelease(make a new Spotlight release)files- List of files to upload. You can use globs (**, *) and you can specify multiple files by specifying them in multiple lines.
Extra arguments when destination is set to release:
version- Version to publish in semver format. Can be omitted when uploading ipa files, otherwise mandatory.track- Name of the release track. Can be omitted when uploading ipa files, otherwise mandatory.
Action will find any Jira tickets mentioned in commits from specified range. Commits can be specified:
- At the beginning of the commit's summary, in square brackets. Such as:
[ABC-123] feat: add a feature - Anywhere in the commit body:
feat: add a feature
this fixes ABC-123
Inputs:
from(Required) - Commit to start generating changelog from (exclusive)to(Optional) - Last commit (inclusive) to generate changelog fromonlyResolvedTickets(Optional) - When set totrue, only include tickets where ticket mention in commit is preceded by a resolution keyword (for examplefixes ABC-123instead of justABC-123)
Outputs:
tickets- Comma-separated list of tickets
- name: Get jira tickets
uses: inovait/actions-common/jira-get-tickets-from-commits@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
id: jira-tickets
with:
from: 13d7b87c7f6ac5d2e0064a229cf6b2e97766d97f
to: 1b1a0f2f5790837d0986934ab080a02123cfd763
- run: 'echo Jira tickets: ${{ steps.jira-tickets.outputs.tickets }}'Action behaves identically to the above jira action, except that you do not pass from and to inputs.
- name: Get jira tickets
uses: inovait/actions-common/jira-get-tickets-since-last-build@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
id: jira-tickets
- run: 'echo Jira tickets: ${{ steps.jira-tickets.outputs.tickets }}'Before you do any of the below actions, you have to login to Jira. See Jira Login for more info.
Example usage:
- name: Login to Jira
uses: justin-jhg/gajira-login@6623f76f877312554aa302d1181e2a81e8cde542
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}Inputs:
tickets- Comma-separated list of tickets. Can be output of the above "get jira tickets" task.jql- JQL query. When specified, action will add a comment to all tickets that match this JQL.
(eitherticketsorjqlis required)comment- Comment to make. Can be in Atlassian Document Format.
Example usage:
- name: Make a jira comment
uses: inovait/actions-common/jira-comment@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
tickets: JT-1,JT-2
comment: 'This ticket is included in build 1.2.${{ env.BUILD_NUMBER }}.'Inputs:
tickets- Comma-separated list of tickets to transition. Can be output of the above "get jira tickets" task.jql- JQL query. When specified, action will consider all tickets that match this JQL for transition.
(eitherticketsorjqlis required)from- (Optional) Only transition tickets that are currently in this stateto- State to transition toresolution- (Optional) Sets the resolution of tickets to specified value
Example usage:
- name: Transition tickets to test
uses: inovait/actions-common/jira-transition@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
tickets: JT-1,JT-2
from: 'In Progress'
to: 'Ready to Test'
resolution: '{"Bug": "Fixed", "Default": "Done"}'Inputs:
tickets- Comma-separated list of tickets to update. Can be output of the above "get jira tickets" task.jql- JQL query. When specified, action will update all tickets that match this JQL for transition.
(eitherticketsorjqlis required)field- (Optional) Custom field for specifying field of tickets to append
Possible fields to update:
fixVersion, priority
Example usage:
- name: Update jira tickets
uses: inovait/actions-common/jira-update@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
tickets: JT-1,JT-2
fixVersion: '1.0.0'
priority: 'Low'Custom field example usage:
- name: Update jira tickets
uses: inovait/actions-common/jira-update@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
tickets: JT-1,JT-2
field: 'customfield_10029+=New_Tag'Increase semantic version. Version can be input in two ways:
version- direct old version input, feel free to use github action contexts. New version can be accessed usingoutputaction output.versionFile- old version is read from the specified text file, and new version is written back to the file
You also need to specify increment which tells the action which part of the version should be bumped.
Can be major, minor, patch, none or auto.
In auto mode, release type will be automatically selected based on commit messages from provided range. Commits need to follow Conventional Commits spec for this to work. You also need to specify these in auto mode:
from(Required) - Commit to start searching from (exclusive)to(Optional) - Last commit (inclusive) to include in search
Example usage:
- name: Bump minor version
uses: inovait/actions-common/bump-version@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
versionFile: 'version.txt'
increment: minor- name: Bump major version from file
id: version-step
uses: inovait/actions-common/bump-version@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
version: '1.0.0'
increment: major
- echo: 'New version: ${{ steps.version-step.outputs.version }}'- name: Bump version from commits
id: version-step
uses: inovait/actions-common/bump-version@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
versionFile: 'version.txt'
increment: auto
from: 13d7b87c7f6ac5d2e0064a229cf6b2e97766d97f
to: 1b1a0f2f5790837d0986934ab080a02123cfd763Action behaves identically to the above version bump action, except that increment is always auto and
you do not pass from and to inputs - they will be automatically populated to include all commits made since last successful build of this workflow.
- name: Bump version from commits since last build
id: version-step
uses: inovait/actions-common/bump-version-since-last-build@da9a92bef70418c0a9cdd17eafab499fc42428cd #v17
with:
versionFile: 'version.txt'