-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: convenience workflow for update major release tag #28
Open
oliver-butterley
wants to merge
2
commits into
leanprover:main
Choose a base branch
from
oliver-butterley:tag-utility
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Update major version tag | ||
run-name: Set ${{ github.event.inputs.major_version }} to point to ${{ github.event.inputs.target }} | ||
|
||
# Each time there is a minor release, this workflow can be manually run in order to update the major release tag to point to the latest release. | ||
# Can also be used for rollback if the latest release is found to have problems. | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
target: | ||
description: The tag or reference to use | ||
required: true | ||
major_version: | ||
type: choice | ||
description: The major version to update | ||
options: | ||
- v1-alpha | ||
- v1 | ||
# add items to this list when new major releases are released | ||
|
||
jobs: | ||
tag: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # required to commit to the repo | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Git config | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
- name: Tag new target | ||
run: git tag -f ${{ github.event.inputs.major_version }} ${{ github.event.inputs.target }} | ||
- name: Push new tag | ||
run: git push origin ${{ github.event.inputs.major_version }} --force | ||
|
||
# bot user details: https://api.github.com/users/github-actions%5Bbot%5D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a link to a doc which explains how this github actions bot user works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish there was something in the docs about this! I failed to find anything relevant. The best I can suggest is the conversation on this PR for actions/checkout.
I suspect we can set anything as the git user and the tagging still works, I believe the choice is just to get the correct image when commits are view on gh webpages.