Skip to content

Commit 029e0b4

Browse files
authored
Update changelog.yml
1 parent e3afb8d commit 029e0b4

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

.github/workflows/changelog.yml

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
1-
name: "Update Changelog"
2-
31
on:
42
release:
5-
types: [released]
3+
type: published
64

75
jobs:
8-
update:
6+
comment:
97
runs-on: ubuntu-latest
10-
118
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v2
9+
- uses: actions/checkout@v2
10+
- name: Set up Python
11+
uses: actions/setup-python@v1
1412
with:
15-
ref: main
16-
17-
- name: Update Changelog
18-
uses: stefanzweifel/changelog-updater-action@v1
13+
python-version: "3.8"
14+
- name: Update version
15+
id: version
16+
run: |
17+
echo "GITHUB_REF is a tag you set for the release"
18+
echo "Your GitHub ref: ${GITHUB_REF}"
19+
VERSION=`echo "${GITHUB_REF}" | cut -f 3 -d "/"`
20+
echo "Preparing version ${VERSION}"
21+
echo "__version__ = \"${VERSION}\"" > __version__.py
22+
echo "##[set-output name=version;]$(echo ${VERSION})"
23+
- uses: vemel/update-changelog@0.0.1
24+
id: changelog
1925
with:
20-
release-notes: ${{ github.event.release.body }}
21-
latest-version: ${{ github.event.release.name }}
22-
23-
- name: Commit updated CHANGELOG
24-
uses: stefanzweifel/git-auto-commit-action@v4
26+
version: ${{ steps.version.outputs.version }}
27+
- name: Create Pull Request
28+
uses: peter-evans/create-pull-request@v2
2529
with:
26-
branch: main
27-
commit_message: Update CHANGELOG
28-
file_pattern: CHANGELOG.md
30+
commit-message: Release ${{ steps.version.outputs.version }}
31+
labels: release, bot
32+
title: "Release ${{ steps.version.outputs.version }}"
33+
body: |
34+
# Release ${{ steps.version.outputs.version }}
35+
36+
Merge this PR to update your version and changelog!
37+
38+
## Included Pull Requests
39+
40+
${{ steps.changelog.outputs.pulls_list_md }}

0 commit comments

Comments
 (0)