Skip to content

Commit

Permalink
removed retriggering of workflow from approval for internal prs
Browse files Browse the repository at this point in the history
  • Loading branch information
lmnzx committed Oct 1, 2024
1 parent 62885aa commit 26763ac
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/branchtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Deploy and Test Branch
on:
pull_request_review:
types: [submitted]
pull_request:
types: [opened, synchronize, reopened]
pull_request_target:
types: [opened, synchronize, reopened]
workflow_dispatch:
Expand All @@ -17,16 +15,15 @@ on:
jobs:
check-pr-approval:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_review' || github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
if: github.event_name != 'workflow_dispatch'
outputs:
approved: ${{ steps.check.outputs.approved }}
steps:
- name: Check if PR is approved or author is a contributor
id: check
run: |
if [[ "${{ github.event.review.state }}" == "approved" ]] || \
[[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.state }}" == "open" ]] || \
[[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.author_association }}" =~ ^(OWNER|MEMBER|COLLABORATOR)$ ]]; then
[[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.author_association }}" =~ ^(OWNER|MEMBER|COLLABORATOR)$ ]]; then
echo "approved=true" >> $GITHUB_OUTPUT
else
echo "approved=false" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 26763ac

Please sign in to comment.