File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 20
20
image : alpine
21
21
22
22
steps :
23
+ - name : Install git
24
+ run : apk add --no-cache git
25
+ shell : sh
26
+
23
27
- name : Checkout
24
28
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25
29
@@ -39,15 +43,24 @@ jobs:
39
43
id : pr-number
40
44
shell : sh
41
45
env :
46
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42
47
max_attempts : 5 # Maximum attempts to find the PR number
43
48
sleep_time : 3 # Time to wait between attempts in seconds
44
49
run : |
45
50
. ./scripts/lib.sh
46
51
52
+ if ! git config --global --add safe.directory "${GITHUB_WORKSPACE}"; then
53
+ die "Failed to add safe.directory to git config."
54
+ fi
55
+
47
56
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
48
57
num="${{ github.event.inputs.pr_number }}"
49
58
else
50
59
commit_sha=$(git rev-parse HEAD)
60
+ if [ -z "${commit_sha}" ]; then
61
+ die "Failed to get the current commit SHA."
62
+ fi
63
+
51
64
# Try up to 5 times to find the merged PR for this commit.
52
65
attempts=0
53
66
info "Searching for merged PR number for commit: ${commit_sha}"
You can’t perform that action at this time.
0 commit comments