bump-snap-version¶
The bump-snap-version workflow automates the creation
of a version-bump pull request.
It is designed to work together with the
upstream-gh-tag-monitor
workflow:
when a new version is detected upstream and an issue is opened,
this workflow can be triggered to create a pull request
that updates the snapcraft.yaml file with the new version.
The workflow operates in two modes:
Automatic mode: when called without
new-versionandissue-to-close, the workflow finds the latest open monitoring issue (for example[CI] Found version 'v0.27.0' upstream), extracts the version from it and proceeds with the bump. If no monitoring issue is found, the workflow exits successfully without making changes.Manual mode: when
new-versionandissue-to-closeare both provided, the workflow uses those values directly. Providing only one of the two fails the workflow.
In both modes, the workflow:
Checks out the repository at
git-ref.Skips if a pull request closing the issue already exists.
Creates a new branch named after the version, for example
feat/bump-v0.27.0.Updates the
snapcraft.yamlfile:if
adopt-infois used, only thesource-tagfield of the referenced part is updated;otherwise, the top-level
versionfield is updated (with thevprefix removed) and thesource-tagfield of the parts is updated;if several parts declare a
source-tag, thesource-tag-partinput must specify which part to update.
Commits, pushes the branch and opens a pull request that closes the monitoring issue, as well as any older open monitoring issues.
Usage¶
jobs:
bump:
permissions:
contents: write
pull-requests: write
issues: read
uses: canonical/robotics-actions-workflows/.github/workflows/bump-snap-version.yaml@main
Inputs¶
Input |
Type |
Default |
Required |
Description |
|---|---|---|---|---|
|
string |
|
no |
The new version tag, for example |
|
string |
|
no |
The issue number that this pull request resolves, for example |
|
string |
|
no |
The directory of the Snapcraft project. |
|
string |
|
no |
The pull request reviewer, in the form |
|
string |
|
no |
The part name to update the |
|
string |
|
no |
The branch to checkout. |
Secrets¶
This workflow takes no secrets.
The GITHUB_TOKEN is used to list issues,
push the branch and open the pull request.
Note
Pull requests created with the default GITHUB_TOKEN
do not trigger further workflow runs.
One must thus manually trigger it.
Outputs¶
The workflow declares no workflow outputs and uploads no artifacts. Its outcome is a pull request that bumps the snap version, or no change when no monitoring issue is open or when a matching pull request already exists.
Permissions¶
contents: writepull-requests: writeissues: read