Skip to content

Commit 564f963

Browse files
committed
fix api url, changelog, tag
1 parent e619352 commit 564f963

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/release-post-merge.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
branches:
77
- 'main'
88

9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
913
env:
1014
GITHUB_USER: "datavisyn-bot"
1115
GITHUB_TOKEN: ${{ secrets.DATAVISYN_BOT_REPO_TOKEN }}
@@ -20,7 +24,14 @@ jobs:
2024
uses: actions/checkout@v4
2125
with:
2226
token: ${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
23-
27+
fetch-depth: 0
28+
29+
- name: Create and Push Tag
30+
run: |
31+
TAG_NAME="v$(echo "$PR_TITLE" | awk '{print $2}')"
32+
git tag "$TAG_NAME"
33+
git push origin "$TAG_NAME"
34+
2435
- name: Generate Release Notes
2536
id: generate-release-notes
2637
run: |
@@ -36,12 +47,12 @@ jobs:
3647
3748
- name: Create GitHub Release
3849
run: |
39-
TAG_NAME="v$(echo "${{ github.event.pull_request.title }}" | awk '{print $2}')"
50+
TAG_NAME="v$(echo "$PR_TITLE" | awk '{print $2}')"
4051
RELEASE_NOTES=$(cat release_notes.txt)
4152
curl -X POST \
42-
-H "Authorization: token $GITHUB_TOKEN" \
53+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
4354
-H "Accept: application/vnd.github.v3+json" \
44-
https://api.github.com/repos/${{ github.repository.full_name }}/releases \
55+
https://api.github.com/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/releases \
4556
-d '{
4657
"tag_name": "'"$TAG_NAME"'",
4758
"target_commitish": "main",
@@ -66,5 +77,5 @@ jobs:
6677
jq --arg new_version "$NEW_VERSION" '.version = $new_version' package.json > tmp.json && mv tmp.json package.json
6778
6879
git add package.json
69-
git commit -m "Bump to $NEW_VERSION"
80+
git commit -m "chore: prepare next dev release"
7081
git push origin develop

0 commit comments

Comments
 (0)