Skip to content

Commit 9d5c18d

Browse files
author
You
committed
ci: make changelog releases deterministic
1 parent db8ed49 commit 9d5c18d

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/changelog.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ jobs:
1919
run: git tag -d beta
2020
continue-on-error: true
2121

22-
- run: npx changelogithub # or changelogithub@0.12 if ensure the stable result
22+
- name: Verify release token
2323
env:
24-
GITHUB_TOKEN: ${{secrets.MY_TOKEN}}
24+
GH_TOKEN: ${{ secrets.MY_TOKEN }}
25+
TAG_NAME: ${{ github.ref_name }}
26+
run: |
27+
if [ -z "$GH_TOKEN" ]; then
28+
echo "::error::MY_TOKEN is not configured"
29+
exit 1
30+
fi
31+
curl --fail-with-body --silent --show-error \
32+
--header "Authorization: Bearer ${GH_TOKEN}" \
33+
--header "Accept: application/vnd.github+json" \
34+
--header "X-GitHub-Api-Version: 2022-11-28" \
35+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/${TAG_NAME}" \
36+
>/dev/null
37+
38+
- name: Create GitHub release
39+
run: npx --yes changelogithub@13.16.1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}

0 commit comments

Comments
 (0)