Skip to content

Commit

Permalink
fix: remove fork check on attributions update
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptodev-2s committed May 7, 2024
1 parent d481305 commit 142a649
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions .github/workflows/update-attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,10 @@ on:
types: created

jobs:
is-fork-pull-request:
name: Determine whether this issue comment was on a pull request from a fork
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '@metamaskbot update-attributions') }}
runs-on: ubuntu-latest
outputs:
IS_FORK: ${{ steps.is-fork.outputs.IS_FORK }}
steps:
- uses: actions/checkout@v4
- name: Determine whether this PR is from a fork
id: is-fork
run: echo "IS_FORK=$(gh pr view --json isCrossRepository --jq '.isCrossRepository' "${PR_NUMBER}" )" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}

react-to-comment:
name: React to the comment
runs-on: ubuntu-latest
needs: is-fork-pull-request
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '@metamaskbot update-attributions') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -44,9 +28,7 @@ jobs:
prepare:
name: Prepare dependencies
runs-on: ubuntu-latest
needs: is-fork-pull-request
# Early exit if this is a fork, since later steps are skipped for forks
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '@metamaskbot update-attributions') }}
outputs:
COMMIT_SHA: ${{ steps.commit-sha.outputs.COMMIT_SHA }}
steps:
Expand Down Expand Up @@ -101,9 +83,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- prepare
- is-fork-pull-request
- update-attributions
if: ${{ needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -167,10 +147,8 @@ jobs:

failure-comment:
name: Comment about the attributions update failure
if: ${{ always() && needs.is-fork-pull-request.outputs.IS_FORK == 'false' }}
runs-on: ubuntu-latest
needs:
- is-fork-pull-request
- check-status
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit 142a649

Please sign in to comment.