Skip to content

Commit add423f

Browse files
fix: add updated workflow with corrected bot username and event handling
- Add 'opened' trigger to catch PRs when bot immediately applies label - Fix bot username to github-actions[bot] (verified via API and commit history) - Restructure condition to handle both 'labeled' and 'opened' events * 'labeled': uses github.event.label.name * 'opened': uses github.event.pull_request.labels.*.name * Prevents 'opened' event from failing due to missing github.event.label This enables the auto-merge workflow to work with Speakeasy SDK generation PRs.
1 parent c34ce15 commit add423f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎.github/workflows/auto-merge-speakeasy-pr.yaml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@ concurrency:
1818
jobs:
1919
auto-merge:
2020
if: |
21-
github.event.sender.login == 'app/github-actions' &&
22-
github.event.pull_request.user.login == 'app/github-actions' &&
21+
github.event.sender.login == 'github-actions[bot]' &&
22+
github.event.pull_request.user.login == 'github-actions[bot]' &&
2323
startsWith(github.event.pull_request.head.ref, 'speakeasy-sdk-regen-') &&
2424
contains(github.event.pull_request.title, '🐝 Update SDK') &&
25-
contains(fromJSON('["patch", "minor", "major"]'), github.event.label.name)
25+
(
26+
(github.event.action == 'labeled' && contains(fromJSON('["patch", "minor", "major"]'), github.event.label.name)) ||
27+
(github.event.action == 'opened' &&
28+
(contains(github.event.pull_request.labels.*.name, 'patch') ||
29+
contains(github.event.pull_request.labels.*.name, 'minor') ||
30+
contains(github.event.pull_request.labels.*.name, 'major')))
31+
)
2632
runs-on: ubuntu-latest
2733
steps:
2834
- name: Close superseded Speakeasy PRs

0 commit comments

Comments
 (0)