Skip to content

Commit

Permalink
GHA: Simplify step to check author's membership (duckduckgo#3609)
Browse files Browse the repository at this point in the history
<!--
Note: This checklist is a reminder of our shared engineering
expectations.
The items in Bold are required
If your PR involves UI changes:
1. Upload screenshots or screencasts that illustrate the changes before
/ after
2. Add them under the UI changes section (feel free to add more columns
if needed)
If your PR does not involve UI changes, you can remove the **UI
changes** section

At a minimum, make sure your changes are tested in API 23 and one of the
more recent API levels available.
-->

Task/Issue URL:
https://app.asana.com/0/1174433894299346/1205611423977807/f

### Description
- We don’t need to use Github API to check the membership of the author
of a PR
- Any PR created by a fork should go through the External PR step.
  • Loading branch information
malmstein authored Oct 2, 2023
1 parent 68e1d22 commit 259ef63
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/action-pr-opened.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ jobs:
validate-pr:
name: Validate Pull Request
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.step1.outputs.external }}
steps:
- name: Checking Pull Request sender membership
id: step1
uses: malmstein/github-asana-action@master
with:
github-pat: ${{ secrets.GT_DAXMOBILE }}
action: 'check-pr-membership'
run: echo "Checking author membership in the organization"
process-internal-pr:
name: Process internal Pull Request
if: ${{ needs.validate-pr.outputs.output1 == 'false' }}
if: ${{ github.event.pull_request.user.login == github.event.pull_request.base.repo.owner.login}}
runs-on: ubuntu-latest
needs: validate-pr
permissions:
Expand All @@ -34,7 +28,7 @@ jobs:
is-pinned: true
process-external-pr:
name: Process external Pull Request
if: ${{ needs.validate-pr.outputs.output1 == 'true' }}
if: ${{ github.event.pull_request.user.login != github.event.pull_request.base.repo.owner.login}}
runs-on: ubuntu-latest
needs: validate-pr
permissions:
Expand Down

0 comments on commit 259ef63

Please sign in to comment.