Skip to content

Commit f4f5523

Browse files
ci: fixing broken automerge (#1223)
* Attempt to fix the broken automerge flow * Remove PR info * Trying to fix the automerge functionality Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 20bd14d commit f4f5523

File tree

2 files changed

+13
-24
lines changed

2 files changed

+13
-24
lines changed

.github/workflows/automerge.yml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,23 @@ name: Auto-merge pull request if requirements met
55
on:
66
workflow_run:
77
workflows: ["Build & test"]
8-
types: [completed]
8+
types:
9+
- completed
910

1011
jobs:
1112
try_to_merge:
1213
name: Try to merge the PR if allowed
1314
runs-on: ubuntu-latest
1415
steps:
15-
- name: Wait for tests to succeed
16-
uses: fountainhead/[email protected]
17-
id: wait-for-tests
18-
with:
19-
token: ${{ secrets.GITHUB_TOKEN }}
20-
checkName: "Build & test"
21-
ref: ${{ github.event.pull_request.head.sha || github.sha }}
22-
- name: PR ${{ github.event.number }}
23-
if: |
24-
(
25-
steps.wait-for-tests.outputs.conclusion == 'success' ||
26-
(
27-
github.event_name == 'workflow_run' &&
28-
github.event.workflow_run.conclusion == 'success'
29-
)
30-
) &&
31-
!contains(github.event.pull_request.labels.*.name, 'work in progress') &&
32-
!contains(github.event.pull_request.labels.*.name, 'on hold') &&
33-
github.event.pull_request.draft == false
34-
uses: "pascalgn/automerge-action@4536e8847eb62fe2f0ee52c8fa92d17aa97f932f"
16+
- name: Attempt merge
17+
if: github.event.workflow_run.conclusion == 'success
18+
uses: "pascalgn/[email protected]"
3519
env:
3620
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
37-
MERGE_LABELS: "ready to merge,!work in progress!,!on hold,!blocked,!needs: code updates,!needs: additional info,!needs: AT updates,!needs: changelog,!ready: branch testing,!ready: browser testing"
38-
MERGE_REMOVE_LABELS: Ready to merge
21+
MERGE_LABELS: "!work in progress!,!on hold,!blocked,!needs: code updates,!needs: additional info,!needs: AT updates,!needs: changelog,!ready: branch testing,!ready: browser testing"
22+
MERGE_REMOVE_LABELS: "ready to merge"
3923
MERGE_METHOD: squash
4024
MERGE_COMMIT_MESSAGE: "pull-request-title"
4125
MERGE_RETRIES: 3
4226
MERGE_RETRY_SLEEP: 10000
43-
UPDATE_LABELS: "ready to merge,!work in progress!,!blocked"
4427
UPDATE_METHOD: rebase

.github/workflows/tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
- "generators/**"
1919
- "**/*.md"
2020
- "**/*.text"
21+
- "*.md"
2122
# Build when PRs are merged into master/main
2223
push:
2324
branches: [master, main]
@@ -33,6 +34,7 @@ env:
3334

3435
# Turn this on to debug an action
3536
# GITHUB_CONTEXT: ${{ toJson(github) }}
37+
3638
jobs:
3739
build:
3840
name: Compile project
@@ -44,6 +46,10 @@ jobs:
4446
node: [10]
4547
# Confirm that the PR is not in draft
4648
if: |
49+
(
50+
github.event_name == 'labeled' &&
51+
(github.event.label.name == 'run e2e' || github.event.label.name == 'ready to merge')
52+
) ||
4753
(
4854
github.event_name == 'pull_request' &&
4955
github.event.pull_request.draft == false

0 commit comments

Comments
 (0)