Skip to content

Commit

Permalink
Only run "design approved" check when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Jul 10, 2024
1 parent 7d903fc commit 714583c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/merge-checks.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/trigger-merge-checks.yml
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"'"}'

0 comments on commit 714583c

Please sign in to comment.