Skip to content

Commit

Permalink
fix api url, changelog, tag
Browse files Browse the repository at this point in the history
  • Loading branch information
dvviktordelev committed Nov 12, 2024
1 parent e619352 commit 564f963
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/release-post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
branches:
- 'main'

permissions:
contents: write
pull-requests: write

env:
GITHUB_USER: "datavisyn-bot"
GITHUB_TOKEN: ${{ secrets.DATAVISYN_BOT_REPO_TOKEN }}
Expand All @@ -20,7 +24,14 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}

fetch-depth: 0

- name: Create and Push Tag
run: |
TAG_NAME="v$(echo "$PR_TITLE" | awk '{print $2}')"
git tag "$TAG_NAME"
git push origin "$TAG_NAME"
- name: Generate Release Notes
id: generate-release-notes
run: |
Expand All @@ -36,12 +47,12 @@ jobs:
- name: Create GitHub Release
run: |
TAG_NAME="v$(echo "${{ github.event.pull_request.title }}" | awk '{print $2}')"
TAG_NAME="v$(echo "$PR_TITLE" | awk '{print $2}')"
RELEASE_NOTES=$(cat release_notes.txt)
curl -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository.full_name }}/releases \
https://api.github.com/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/releases \
-d '{
"tag_name": "'"$TAG_NAME"'",
"target_commitish": "main",
Expand All @@ -66,5 +77,5 @@ jobs:
jq --arg new_version "$NEW_VERSION" '.version = $new_version' package.json > tmp.json && mv tmp.json package.json
git add package.json
git commit -m "Bump to $NEW_VERSION"
git commit -m "chore: prepare next dev release"
git push origin develop

0 comments on commit 564f963

Please sign in to comment.