@@ -14,25 +14,12 @@ jobs:
1414 steps :
1515 - name : Checkout PR base
1616 uses : actions/checkout@v4
17- # This checks out the base of the PR, not the PR head itself initially
1817
1918 - name : Setup Git User
2019 run : |
2120 git config --global user.name 'External PR Mirror Bot'
2221 git config --global user.email 'bot@users.noreply.github.com'
2322
24- - name : Fetch PR branch from fork/external
25- env :
26- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Use built-in token to fetch from public fork
27- run : |
28- # The PR branch is available at 'refs/pull/PULL_REQUEST_NUMBER/head'
29- # We fetch it into a local branch with a unique name
30- # Using github.event.pull_request.head.sha ensures we get the exact commit
31- git fetch origin pull/${{ github.event.pull_request.number }}/head:external-pr-${{ github.event.pull_request.number }}
32- git checkout external-pr-${{ github.event.pull_request.number }}
33- echo "Checked out PR branch: external-pr-${{ github.event.pull_request.number }}"
34- git show --summary # Show commit details
35-
3623 - uses : wei/git-sync@v3
3724 name : Push branch to Internal Repository
3825 with :
@@ -75,21 +62,17 @@ jobs:
7562 echo "::error::Failed to create or find existing internal PR."
7663 exit 1
7764 fi
78- else
79- echo "Internal PR created: $INTERNAL_PR_URL"
80- echo "INTERNAL_PR_URL=$INTERNAL_PR_URL" >> $GITHUB_OUTPUT
8165 fi
8266
8367
8468 - name : Comment on and Close External PR
8569 if : steps.create_internal_pr.outputs.INTERNAL_PR_URL != '' # Only if internal PR was created/found
8670 env :
87- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Built-in token for actions on ROCm/aqlprofile
71+ GH_TOKEN : ${{ secrets.EXTERNAL_REPO_TOKEN }} # Built-in token for actions on ROCm/aqlprofile
8872 EXTERNAL_PR_NUMBER : ${{ github.event.pull_request.number }}
8973 EXTERNAL_REPO : ${{ github.repository }} # e.g., ROCm/aqlprofile
90- INTERNAL_PR_URL : ${{ steps.create_internal_pr.outputs.INTERNAL_PR_URL }}
9174 run : |
92- COMMENT_BODY="This pull request has been mirrored to our internal repository for review and integration: ${INTERNAL_PR_URL} . This external PR will now be closed . Thank you for your contribution!"
75+ COMMENT_BODY="This pull request has been mirrored to our internal repository for review and integration. Thank you for your contribution!"
9376
9477 gh pr comment "$EXTERNAL_PR_NUMBER" \
9578 --repo "$EXTERNAL_REPO" \
0 commit comments