Skip to content

Commit 1b90301

Browse files
committed
fix(actions): add instruction and fix workflow trigger condition
1 parent cbad923 commit 1b90301

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/create-release-draft.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ name: Create release draft
22
on:
33
workflow_dispatch:
44
pull_request:
5+
types:
6+
- closed
57
branches:
68
- 'release-*'
79

810
jobs:
911
create-draft:
12+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
1013
name: Create release draft
1114
runs-on: ubuntu-latest
1215
steps:
@@ -35,6 +38,7 @@ jobs:
3538
run: |
3639
gh release create "v${{ steps.version.outputs.version }}" \
3740
--title "v${{ steps.version.outputs.version }}" \
41+
--target "${{ github.base_ref }}" \
3842
--generate-notes \
3943
--draft \
4044
dist/release/*

hack/create-release-pr.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/bash
22

3+
### This script creates a new release PR
4+
# - install gh cli and semver-cli (go install github.com/davidrjonas/semver-cli@latest)
5+
# - create and push "release-X.Y" branch
6+
# - checkout this branch locally
7+
# - run this script from repo root: ./hack/create-release-pr.sh
8+
# - merge the PR
9+
# It will trigger the release workflow that would create release draft on github
10+
311
RELEASE_BRANCH="$(git rev-parse --abbrev-ref HEAD || true)"
412
set -eux
513
set -o pipefail
@@ -20,7 +28,7 @@ make manifests
2028

2129
git checkout -b "feat/new-version-${NEW_VERSION}"
2230
git commit -m "Release ${NEW_VERSION}" VERSION manifests/
23-
git push
31+
git push --set-upstream origin "feat/new-version-${NEW_VERSION}"
2432
gh label --repo $(git remote get-url origin) create --force release
2533
gh pr --repo $(git remote get-url origin) \
2634
create \

0 commit comments

Comments
 (0)