Skip to content

Commit

Permalink
Merge pull request #8045 from jrjohnson/ready-to-merge-label
Browse files Browse the repository at this point in the history
Replace Approval Based UI Workflow
  • Loading branch information
jrjohnson committed Aug 6, 2024
2 parents 9b5bf17 + f9c01ea commit ced510c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 48 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/fail-do-not-merge.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/required-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Required Labels

on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce--ready-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
labels: |
ready to merge
message: "Add the 'ready to merge' label to merge this PR"
prevent-donotmerge-label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 0
labels: "DO NOT MERGE"
message: "DO NOT MERGE label is not allowed on this PR"
36 changes: 5 additions & 31 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: User Interface Tests

on:
pull_request:
types: [labeled, ready_for_review, synchronize]
pull_request_review:
types: [submitted]
types: [labeled, opened, synchronize]

concurrency:
group: ui-${{ github.head_ref || github.ref }}
Expand All @@ -15,29 +13,11 @@ env:
COVERAGE: false

jobs:
checkReviews:
runs-on: ubuntu-latest
outputs:
reviewState: ${{ steps.reviews.outputs.reviewState }}
if: github.event.pull_request.draft == false
steps:
- id: reviews
run: |
reviewState=$(gh pr view ${{ github.event.pull_request.number }} \
--repo ${{ github.repository }} \
--json reviewDecision \
--jq '.reviewDecision')
echo "reviewState=$reviewState" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
browserstack-test:
name: Browser Stack Test
runs-on: ubuntu-latest
timeout-minutes: 120
needs: [checkReviews]
if: |
github.event.pull_request.draft == false &&
needs.checkReviews.outputs.reviewState == 'APPROVED'
if: contains(github.event.pull_request.labels.*.name, 'ready to merge')
strategy:
fail-fast: false
max-parallel: 1
Expand Down Expand Up @@ -78,10 +58,7 @@ jobs:
name: Firefox Tests
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [checkReviews]
if: |
github.event.pull_request.draft == false &&
needs.checkReviews.outputs.reviewState == 'APPROVED'
if: contains(github.event.pull_request.labels.*.name, 'ready to merge')
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -118,11 +95,9 @@ jobs:
percy:
name: Test and Capture Screenshots
runs-on: ubuntu-latest
needs: [firefox-test, browserstack-test, checkReviews]
needs: [firefox-test, browserstack-test]
timeout-minutes: 20
if: |
github.event.pull_request.draft == false &&
needs.checkReviews.outputs.reviewState == 'APPROVED'
if: contains(github.event.pull_request.labels.*.name, 'ready to merge')
strategy:
fail-fast: false
matrix:
Expand All @@ -143,4 +118,3 @@ jobs:
run: pnpm --filter ${{ matrix.workspace }} exec percy exec -- ember test
env:
PERCY_TOKEN: ${{ vars.PERCY_TOKEN }}
PERCY_PULL_REQUEST: ${{ github.event.pull_request.number }}
5 changes: 5 additions & 0 deletions .github/workflows/update-transitive-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
[1]: https://github.com/peter-evans/create-pull-request
branch: auto-update-dependencies
labels: dependencies,run percy tests
- name: Add Ready Label
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr edit --add-label "ready to merge" ${{ steps.cpr.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Approve Pull Request
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr review --approve -b "Auto Approved" ${{ steps.cpr.outputs.pull-request-number }}
Expand Down

0 comments on commit ced510c

Please sign in to comment.