Skip to content

Commit e205e2b

Browse files
committed
chore(fix): release automation
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
1 parent a6f7f88 commit e205e2b

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

.github/workflows/release-changelog.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ jobs:
1515
steps:
1616
- name: Update notes
1717
run: |
18-
NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ github.ref_name }} | jq -r '.body')
19-
RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/${{ github.repository }}/releases/tags/${{ github.ref_name }} | jq -r '.id')
20-
gh api --method PATCH -H "Accept: application/vnd.github+json" "/repos/${{ github.repository }}/releases/$RELEASE_ID" -f "body=$NEW_NOTES"
18+
TAG="${{ github.ref_name }}"
19+
if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
20+
NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ github.ref_name }} | jq -r '.body')
21+
RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/${{ github.repository }}/releases/tags/${{ github.ref_name }} | jq -r '.id')
22+
gh api --method PATCH -H "Accept: application/vnd.github+json" "/repos/${{ github.repository }}/releases/$RELEASE_ID" -f "body=$NEW_NOTES"
23+
fi
2124
env:
2225
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2326
RELEASE_TAG: ${{ github.event.release.tag_name }}
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: Update Major Tag
22
on:
33
workflow_dispatch:
4-
push:
5-
tags:
6-
- 'v[0-9]+.[0-9]+.[0-9]+'
4+
release:
5+
types: [published]
76

87
permissions:
98
contents: write
@@ -16,6 +15,9 @@ jobs:
1615
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1716
- run: |
1817
TAG="${{ github.ref_name }}"
19-
TAG="${TAG%%.*}"
20-
git tag -f "${TAG}"
21-
git push --tags --force
18+
if [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
19+
TAG="${{ github.ref_name }}"
20+
TAG="${TAG%%.*}"
21+
git tag -f "${TAG}"
22+
git push --tags --force
23+
fi

0 commit comments

Comments
 (0)