-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only run "design approved" check when necessary
- Loading branch information
1 parent
7d903fc
commit 714583c
Showing
2 changed files
with
29 additions
and
21 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Trigger Merge Checks | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
types: [synchronize, opened, reopened, labeled, unlabeled] | ||
|
||
permissions: | ||
statuses: write | ||
|
||
jobs: | ||
check-design-approved: | ||
name: Check Design Approved Status | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check design approved status and update check | ||
run: | | ||
set -x pipefail | ||
status_state="pending" | ||
if ${{ contains(github.event.*.labels.*.name, 'design-approved') }}; then | ||
status_state="success" | ||
fi | ||
curl -sSL --fail-with-body \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/${{ github.event.pull_request.head.sha }}" \ | ||
-d '{"context":"Design Approved Check","state":"'"$status_state"'"}' |