Skip to content

Commit ffc0959

Browse files
Merge pull request #1661 from Adyen/fix-release-workflow
fix(ci): ensure release workflow triggers only on merged requests
2 parents 78a6526 + cdde911 commit ffc0959

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
name: Release
1+
name: Automated Release Preparation
22

3+
# This workflow runs automatically when a pull request is merged into the main branch.
4+
# It prepares the next release by creating or updating a "Release PR" with the new version and changelog.
5+
# The final release publication, which triggers the 'publish.yml' workflow, happens when that "Release PR" is merged.
36
on:
47
workflow_dispatch:
58
inputs:
@@ -25,17 +28,21 @@ permissions:
2528

2629
jobs:
2730
release:
28-
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
31+
# 1. Allow manual dispatch
32+
# 2. OR (If it's a PR, it must be merged AND from the same repository)
33+
if: |
34+
github.event_name == 'workflow_dispatch' ||
35+
(github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.repository)
2936
runs-on: ubuntu-latest
3037
steps:
3138
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
3239
- name: Prepare the next main release
33-
uses: Adyen/release-automation-action@596a5a3a2d677ec5329c916d7a4628f8045a5585
40+
uses: Adyen/release-automation-action@3e5694d5b365f344a62436e84049511ef318ecf5
3441
with:
3542
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
3643
develop-branch: main
3744
version-files: pom.xml src/main/java/com/adyen/Client.java README.md
3845
release-title: Adyen Java API Library
3946
pre-release: ${{ inputs.pre-release || false }}
4047
github-release: ${{ inputs.github-release || false }}
41-
separator: .pre.beta
48+
separator: .pre.beta

0 commit comments

Comments
 (0)