Skip to content

Commit

Permalink
Add job update step if PR approved (#25841)
Browse files Browse the repository at this point in the history
* fix: add job update if approved

* chore: update triggers ro only run on review

* feat: add check to ensure we're on the master branch
  • Loading branch information
devindford authored and theraffoul committed Nov 25, 2024
1 parent 457960e commit 8e02e8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/codeowner_review_status.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Code Owners Approval Check

on:
pull_request:
branches:
- master
types: [opened, synchronize, reopened, ready_for_review]
pull_request_review:
types: [submitted, dismissed]

Expand All @@ -29,6 +25,12 @@ jobs:
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number: number });
const { data: files } = await github.rest.pulls.listFiles({ owner, repo, pull_number: number });
// Check if the base branch is master
if (pr.base.ref !== 'master') {
console.log(`Base branch is ${pr.base.ref}. Skipping check.`);
return;
}
// Get CODEOWNERS file content
let codeowners;
try {
Expand Down

0 comments on commit 8e02e8a

Please sign in to comment.