1313 PYTHON_VERSION : ' 3.13'
1414 TASKFILE_VERSION : ' v3.44.0'
1515 TASKFILE_PATH : ' /home/runner/go/bin'
16- if : |
17- github.event_name == 'workflow_dispatch' ||
18- (github.event_name == 'issue_comment' && github.event.comment.body == '/calculate-size' && github.event.issue.pull_request)
1916
2017 services :
2118 registry :
@@ -32,16 +29,11 @@ jobs:
3229 env :
3330 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3431 run : |
35- if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
36- echo "Searching for PR from branch '${{ github.ref_name }}'..."
37- PR_NUMBER=$(gh pr list --state open --head "${{ github.ref_name }}" --json number --jq '.[0].number // empty')
38- if [ -z "$PR_NUMBER" ]; then
39- echo "Not found in current repo, searching across forks..."
40- PR_NUMBER=$(gh pr list --state open --json number,headRefName,headRepositoryOwner --jq ".[] | select(.headRefName == \"${{ github.ref_name }}\") | .number" | head -n1)
41- fi
42- else
43- # For issue_comment, the PR number is in the event context
44- PR_NUMBER=${{ github.event.issue.number }}
32+ echo "Searching for PR from branch '${{ github.ref_name }}'..."
33+ PR_NUMBER=$(gh pr list --state open --head "${{ github.ref_name }}" --json number --jq '.[0].number // empty')
34+ if [ -z "$PR_NUMBER" ]; then
35+ echo "Not found in current repo, searching across forks..."
36+ PR_NUMBER=$(gh pr list --state open --json number,headRefName,headRepositoryOwner --jq ".[] | select(.headRefName == \"${{ github.ref_name }}\") | .number" | head -n1)
4537 fi
4638
4739 if [ -z "$PR_NUMBER" ]; then
5143 fi
5244 echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
5345
54- - name : Checkout PR Branch (for comment trigger)
55- if : github.event_name == 'issue_comment'
56- env :
57- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58- run : |
59- gh pr checkout ${{ steps.pr_info.outputs.pr_number }}
60-
6146 - name : Set up Python
6247 uses : actions/setup-python@v5
6348 with :
0 commit comments