Skip to content

Commit e2ecbc9

Browse files
committed
Fix bugs with prepare release workflow
1 parent ca5be90 commit e2ecbc9

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

.github/workflows/prepare_release.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
1214

1315
- name: Set RELEASE_VERSION
14-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
16+
run: echo "RELEASE_VERSION=$(git describe --tags | awk -F - '{print substr($1,2)}')" >> $GITHUB_ENV
1517

1618
- name: Setup Python 3.8
1719
uses: actions/setup-python@v2
@@ -32,24 +34,35 @@ jobs:
3234
chmod +x tools/gen_changelog.py
3335
poetry run tools/gen_changelog.py ${{ secrets.GITHUB_TOKEN }} v$CURRENT_VERSION v$RELEASE_VERSION
3436
35-
- name: Bump version
37+
- name: Bump pypi version
3638
run: poetry version $RELEASE_VERSION
3739

3840
- name: Create Pull Request
41+
id: cpr
3942
uses: peter-evans/create-pull-request@v3
4043
with:
4144
commit-message: prepare release
42-
title: Prepare for the next release of Maha (v$RELEASE_VERSION)
45+
title: Prepare for the next release of Maha (v${{ env.RELEASE_VERSION }})
4346
branch: prepare-release
4447
base: main
48+
token: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Find Comment
51+
uses: peter-evans/find-comment@v1
52+
id: fc
53+
with:
54+
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
55+
body-includes: Automated changes
4556

46-
- uses: tzkhan/pr-update-action@v2
57+
- name: Create or update comment
58+
uses: peter-evans/create-or-update-comment@v1
4759
with:
48-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
49-
head-branch-regex: "prepare-release"
50-
body-template: |
60+
comment-id: ${{ steps.fc.outputs.comment-id }}
61+
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
62+
body: |
5163
This is an auto-generated PR to prepare for the next release of Maha. The following changes were automatically made:
5264
53-
- Generated changelogs for release v$RELEASE_VERSION. See [changelog](https://maha--${{ steps.cpr.outputs.pull-request-number }}.org.readthedocs.build/en/${{ steps.cpr.outputs.pull-request-number }}/changelog/$RELEASE_VERSION-changelog.html)
54-
- Bumped pypi version to v$RELEASE_VERSION.
65+
- Generated changelogs for release v${{ env.RELEASE_VERSION }}. See [changelog](https://maha--${{ steps.cpr.outputs.pull-request-number }}.org.readthedocs.build/en/${{ steps.cpr.outputs.pull-request-number }}/changelog/${{ env.RELEASE_VERSION }}-changelog.html).
66+
- Bumped pypi version to v${{ env.RELEASE_VERSION }}.
5567
- Updated the citation information.
68+
edit-mode: replace

0 commit comments

Comments
 (0)