File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,15 +173,16 @@ jobs:
173173 python -m twine upload dist/* -u __token__ -p $PYPI_TOKEN
174174 - name : Extract PR Details
175175 run : |
176- if [ "${{ github.event_name }}" = "pull_request" ]; then
177- PR_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/pulls/ ${{ github.event.pull_request.number }})
176+ # Check if the event is a pull request or pull_request_target
177+ if [ " ${{ github.event_name }}" = "pull_request" ] || [ " ${{ github.event_name }}" = "pull_request_target" ]; then
178178 PR_NUMBER=${{ github.event.pull_request.number }}
179- PR_TITLE=$(echo $PR_JSON | jq -r '.title')
179+ PR_TITLE=$(gh pr view $PR_NUMBER --json title --jq '.title')
180180 else
181+ # Use gh to find the PR associated with the commit
181182 COMMIT_SHA=${{ github.event.after }}
182- PR_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/search/issues?q=repo:${{ github.repository }}+is:pr+is: merged+sha:$COMMIT_SHA" )
183- PR_NUMBER=$(echo $PR_JSON | jq -r '.items[0]. number')
184- PR_TITLE=$(echo $PR_JSON | jq -r '.items[0]. title')
183+ PR_JSON=$(gh pr list --search "${COMMIT_SHA}" --state merged --json number,title --jq '.[0]' )
184+ PR_NUMBER=$(echo $PR_JSON | jq -r '.number')
185+ PR_TITLE=$(echo $PR_JSON | jq -r '.title')
185186 fi
186187 echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
187188 echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV
Original file line number Diff line number Diff line change 1- __version__ = "2.0.3 "
1+ __version__ = "2.0.4 "
22
33import torch
44
You can’t perform that action at this time.
0 commit comments