-
Notifications
You must be signed in to change notification settings - Fork 2
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: add bump and tag version workflow #11
base: main
Are you sure you want to change the base?
Changes from 10 commits
61554e5
beb0d4e
00b0e11
e803b78
e4f2b93
9da72ce
34066b5
d566bfb
d69ebb0
557b4ea
44cd335
4361cf9
efb9f00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Bump version | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
tag-prefix: | ||
required: false | ||
default: 'v' | ||
type: string | ||
outputs: | ||
tag: | ||
description: Newly created tag | ||
value: ${{ jobs.bump-version.outputs.tag }} | ||
|
||
jobs: | ||
bump-version: | ||
name: Bump Version on master | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
outputs: | ||
tag: ${{ steps.save-tag.outputs.tag }} | ||
|
||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: cat package.json | ||
run: cat ./package.json | ||
|
||
- name: Automated Version Bump | ||
id: version-bump | ||
uses: phips28/gh-action-bump-version@master | ||
with: | ||
tag-prefix: ${{ inputs.tag-prefix }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This need GITHUB token? better to use https://github.com/snapshot-labs/snapshot.js/blob/master/.github/workflows/update-minor-version.yml#L17 easy to understand There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one just open a PR. The point of this PR is to do everything all a once, at the same time. |
||
|
||
- name: cat package.json | ||
run: cat ./package.json | ||
|
||
- name: Output Step | ||
env: | ||
NEW_TAG: ${{ steps.version-bump.outputs.newTag }} | ||
run: echo "new tag $NEW_TAG" | ||
|
||
- name: Save tag to workflow output | ||
env: | ||
NEW_TAG: ${{ steps.version-bump.outputs.newTag }} | ||
id: save-tag | ||
run: echo "tag=$NEW_TAG" >> "$GITHUB_OUTPUT" |
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.
This action will have permission to merge to master.? 🤔
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.
It works on regular branch. But just tested, and it does not work on protected branch, it requires a
Personal Access Token
, instead ofGITHUB_TOKEN