Skip to content

Commit 847f703

Browse files
authored
master: update release automation workflow to trigger on any release/* merged pull requests
2 parents 0476965 + 5a11ed8 commit 847f703

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/release-automation.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
name: Release Automation
22

33
on:
4-
push:
5-
branches:
6-
- master
4+
pull_request:
5+
types: [closed]
76

87
jobs:
98
create_release:
10-
# We only run it for merge commits from branches release/*
11-
if: startsWith(github.event.head_commit.message, 'Merge pull request') && contains(github.event.head_commit.message, 'from release/')
9+
# We only run it for merged PRs from a release/* branch into master.
10+
if: |
11+
github.event.pull_request.merged == true &&
12+
github.event.pull_request.base.ref == 'master' &&
13+
startsWith(github.event.pull_request.head.ref, 'release/')
1214
runs-on: ubuntu-latest
1315
permissions:
1416
contents: write # to create tags and releases
@@ -17,7 +19,8 @@ jobs:
1719
- name: Checkout code
1820
uses: actions/checkout@v4
1921
with:
20-
# I need a complete history to read the tags and create a PR
22+
# We check out the master branch, which is the state after the merge.
23+
ref: 'master'
2124
fetch-depth: 0
2225

2326
- name: Get Version

0 commit comments

Comments
 (0)