Skip to content

Commit 8eb1260

Browse files
committed
docs: add examples folder
1 parent 8983eb2 commit 8eb1260

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

examples/bump-release.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# YES, YOU CAN COPY-PASTE THIS ACTION AND IT SHOULD WORK
2+
# keep in mind, that it won't trigger other actions because it's using action permissions.
3+
# You can: use a PAT token or a workflow_call to trigger another action
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
bump:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
actions: write
15+
steps:
16+
- uses: actions/checkout@v5
17+
with:
18+
fetch-depth: 0
19+
fetch-tags: true
20+
- name: Set up git config
21+
run: |
22+
git config --global user.name "github-actions[bot]"
23+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
24+
- uses: actions/setup-cz@main
25+
- id: bump-version
26+
run: |
27+
cz bump --yes --annotated-tag
28+
git push --follow-tags
29+
current_version="$(cz version -p --current)" # ATTENTION: You may have to add the v* at the beginning of the version
30+
echo "current_version=$current_version" >> $GITHUB_OUTPUT
31+
- name: Build changelog for Release
32+
env:
33+
CURRENT_VERSION: ${{ steps.bump-version.outputs.current_version }}
34+
run: |
35+
cz changelog --dry-run "${CURRENT_VERSION}" > .changelog.md
36+
- name: Release
37+
uses: softprops/action-gh-release@v2
38+
with:
39+
body_path: ".changelog.md"
40+
tag_name: ${{ steps.bump-version.outputs.current_version }}
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)