-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging changes synced from https://github.com/MicrosoftDocs/dataexpl…
…orer-docs-pr (branch live)
- Loading branch information
Showing
4 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
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,33 @@ | ||
name: Bypass Code Owner Approval | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
bypass_approval: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if PR author is a code owner | ||
id: check-author | ||
run: | | ||
TEAM_MEMBERS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
https://api.github.com/orgs/MicrosoftDocs/teams/kusto-doc-writers/members) | ||
if echo "$TEAM_MEMBERS" | grep -q "\"login\": \"${{ github.actor }}\""; then | ||
DEBUG_IS_CODEOWNER=true | ||
echo "is_codeowner=true" >> $GITHUB_ENV | ||
else | ||
DEBUG_IS_CODEOWNER=false | ||
echo "is_codeowner=false" >> $GITHUB_ENV | ||
fi | ||
echo "::debug::Team members -- $TEAM_MEMBERS" | ||
echo "::debug::is_codeowner -- $DEBUG_IS_CODEOWNER" | ||
- name: Bypass approval if author is a code owner | ||
id: bypass-approval | ||
if: steps.check-author.outputs.is_codeowner == 'true' | ||
run: | | ||
echo "Bypassing approval for code owner" | ||
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \ | ||
-d '{"event":"APPROVE"}' |
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
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
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