Skip to content

Commit 43747fd

Browse files
committed
Handle GitHub release publishing with gh CLI (#531)
1 parent a8f4312 commit 43747fd

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/release-management.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
name: Test and build
1010
runs-on: ubuntu-20.04
1111
outputs:
12+
version: ${{ steps.check_package_version.outputs.version }}
1213
version_changed: ${{ steps.check_package_version.outputs.changed }}
1314
steps:
1415
- name: Clone repository
@@ -71,11 +72,10 @@ jobs:
7172
# `test_and_build` job first so this job is skipped rather than exited with an error.
7273
- name: Publish matching GitHub release draft
7374
id: github_release
74-
uses: JamesMGreene/node-draft-releaser@v1
7575
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
with:
78-
allow_release_name_update: 'false'
76+
GH_TOKEN: ${{ github.token }}
77+
GH_REPO: ${{ github.repository }}
78+
run: gh release edit "v${{ needs.test_and_build.outputs.version }}" --draft=false
7979

8080
- name: Write out the release URL
8181
run: echo "Released at $RELEASE_URL"
@@ -119,6 +119,13 @@ jobs:
119119
with:
120120
persist-credentials: false
121121

122+
# Hard-coded username and email for the GitHub bot user
123+
# https://api.github.com/users/github-actions%5Bbot%5D
124+
- name: Configure Git credentials
125+
run: |
126+
git config user.name github-actions[bot]
127+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
128+
122129
- name: Set up Node.js
123130
uses: actions/setup-node@v4
124131
with:
@@ -150,5 +157,5 @@ jobs:
150157
- name: Install MkDocs
151158
run: pip install 'mkdocs-material>=9.0.0,<10.0.0'
152159

153-
- name: Build MkDocs
160+
- name: Build and deploy MkDocs
154161
run: mkdocs gh-deploy --force

0 commit comments

Comments
 (0)