FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
commitizen/.github/workflows/bumpversion.yml at master · commitizen-tools/commitizen · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
commitizen-tools
/
commitizen
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
349
Star
3.5k
Code
Issues
115
Pull requests
47
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
commitizen
/
.github
/
workflows
/
bumpversion.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
68 lines (64 loc) · 2.54 KB
Breadcrumbs
commitizen
/
.github
/
workflows
/
bumpversion.yml
Copy path
File metadata and controls
68 lines (64 loc) · 2.54 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name
:
Bump version
on
:
push
:
branches
:
-
master
jobs
:
bump-version
:
if
:
${{ github.repository == 'commitizen-tools/commitizen' && !startsWith(github.event.head_commit.message, 'bump:') }}
runs-on
:
ubuntu-latest
name
:
"
Bump version and create changelog with commitizen
"
permissions
:
contents
:
write
actions
:
write
steps
:
-
uses
:
actions/create-github-app-token@v3
id
:
app-token
with
:
app-id
:
${{ vars.APP_ID }}
private-key
:
${{ secrets.PRIVATE_KEY }}
-
name
:
Check out
uses
:
actions/checkout@v7
with
:
token
:
${{ steps.app-token.outputs.token }}
fetch-depth
:
0
fetch-tags
:
true
-
name
:
Get GitHub App User ID
id
:
get-user-id
run
:
echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env
:
GH_TOKEN
:
${{ steps.app-token.outputs.token }}
-
uses
:
commitizen-tools/setup-cz@main
with
:
#
Information extracted from the app token
#
Under actions/create-github-app-token is documented how to generate username and email for the bot
git-user-name
:
"
${{ steps.app-token.outputs.app-slug }}[bot]
"
git-user-email
:
"
${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com
"
-
id
:
bump-version
run
:
|
old_sha="$(git rev-parse HEAD)"
cz --no-raise 21 bump --yes
if [ "$(git rev-parse HEAD)" = "$old_sha" ]; then
echo "No bump-eligible commits found, skipping release."
echo "bumped=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "bumped=true" >> $GITHUB_OUTPUT
git push --follow-tags
new_version="$(cz version -p)"
echo "new_version=$new_version" >> $GITHUB_OUTPUT
new_version_tag="$(cz version -p --tag)"
echo "new_version_tag=$new_version_tag" >> $GITHUB_OUTPUT
-
name
:
Build changelog for Release
if
:
steps.bump-version.outputs.bumped == 'true'
env
:
NEW_VERSION
:
${{ steps.bump-version.outputs.new_version }}
run
:
|
cz changelog --dry-run "${NEW_VERSION}" > .changelog.md
-
name
:
Release
if
:
steps.bump-version.outputs.bumped == 'true'
env
:
GH_TOKEN
:
${{ github.token }}
NEW_VERSION_TAG
:
${{ steps.bump-version.outputs.new_version_tag }}
run
:
|
gh release create "${NEW_VERSION_TAG}" --notes-file .changelog.md
Back
|
FazBrowse Home
|
New Git URL