Skip to content

Commit f445f69

Browse files
authored
Merge pull request #1491 from nscuro/fix-release-workflow
Fix release workflow
2 parents 02313ba + 2ed4f70 commit f445f69

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/ci-publish.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Publish CI
22

33
on:
4-
release:
5-
types:
6-
- created
4+
push:
5+
tags:
6+
- '[0-9]*'
77
workflow_dispatch:
88

99
permissions: {}

.github/workflows/ci-release.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ permissions: {}
2121
jobs:
2222
prepare-release:
2323
runs-on: ubuntu-latest
24-
permissions:
25-
contents: write # Required to create commits.
2624
steps:
2725
- name: Checkout Repository
2826
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag=v6.0.2
27+
with:
28+
token: ${{ secrets.BOT_RELEASE_GITHUB_TOKEN }}
2929

3030
- name: Set up NodeJs
3131
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # tag=v6.3.0
@@ -41,17 +41,18 @@ jobs:
4141
git config user.name "dependencytrack-bot"
4242
git config user.email "[email protected]"
4343
44-
npm version "${VERSION_TO_BUMP}" -m "prepare-release: set version to %s"
44+
npm version "${VERSION_TO_BUMP}" --tag-version-prefix="" -m "prepare-release: set version to %s"
4545
46-
git push origin "HEAD:${GIT_REF}"
46+
VERSION=$(jq -r '.version' package.json)
47+
git push origin "HEAD:${GIT_REF}" "${VERSION}"
4748
4849
- name: Create GitHub Release
4950
env:
50-
GITHUB_TOKEN: ${{ secrets.BOT_RELEASE_TOKEN }}
51+
GITHUB_TOKEN: ${{ secrets.BOT_RELEASE_GITHUB_TOKEN }}
5152
VERSION_TO_BUMP: ${{ github.event.inputs.version-to-bump }}
5253
GIT_REF_NAME: ${{ github.ref_name }}
5354
run: |-
54-
VERSION=`jq -r '.version' package.json`
55+
VERSION=$(jq -r '.version' package.json)
5556
GH_OPTS=""
5657
5758
if [[ "${VERSION_TO_BUMP}" == *pre* ]]; then

0 commit comments

Comments
 (0)