File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,13 @@ jobs:
31
31
- name : Get PR number
32
32
run : |
33
33
echo "GITHUB_REPOSITORY: \"$GITHUB_REPOSITORY\""
34
- echo "github.ref: \"$GITHUB_REF\""
34
+ REF=${{ github.ref }}
35
+ REF=${REF#refs/heads/} # Remove 'refs/heads/' prefix
36
+ echo "REF: \"$REF\""
35
37
API_RESPONSE=$(curl --location --request GET "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open" \
36
38
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}')
37
39
echo "API_RESPONSE: $API_RESPONSE"
38
- PR_NUMBER=$(echo $API_RESPONSE | jq '.[] | select(.head.ref=="'${{ github.ref }} '") | .number')
40
+ PR_NUMBER=$(echo $API_RESPONSE | jq '.[] | select(.head.ref=="'$REF '") | .number')
39
41
echo "PR_NUMBER: $PR_NUMBER"
40
42
if [ -z "$PR_NUMBER" ]; then
41
43
echo "PR_NUMBER is not set. Aborting."
You can’t perform that action at this time.
0 commit comments