6
6
issue_comment :
7
7
types : [created, edited]
8
8
9
+ # Set repository-level permissions
9
10
permissions : write-all
10
11
11
12
jobs :
12
13
enforce-docs-cla :
13
14
runs-on : ubuntu-latest
15
+ # Job-level permissions (inherits from above but can be more restrictive)
14
16
permissions : write-all
15
17
16
18
steps :
@@ -29,21 +31,38 @@ jobs:
29
31
echo "WORKFLOW_AUTH_PUBLIC_PRIVATE_KEY is set"
30
32
fi
31
33
34
+ if [ -z "${{ secrets.GITHUB_PAT }}" ]; then
35
+ echo "GITHUB_PAT is empty or not set"
36
+ else
37
+ echo "GITHUB_PAT is set"
38
+ fi
32
39
echo "==================="
33
40
34
41
- name : Generate Token
35
42
id : generate-token
43
+ continue-on-error : true
36
44
uses : actions/create-github-app-token@v1
37
45
with :
38
46
app-id : " ${{ secrets.WORKFLOW_AUTH_PUBLIC_APP_ID }}"
39
47
private-key : " ${{ secrets.WORKFLOW_AUTH_PUBLIC_PRIVATE_KEY }}"
40
48
49
+ - name : Debug - Token generation result
50
+ run : |
51
+ echo "=== TOKEN GENERATION RESULT ==="
52
+ echo "Token step outcome: ${{ steps.generate-token.outcome }}"
53
+ if [ "${{ steps.generate-token.outcome }}" = "success" ]; then
54
+ echo "GitHub App token generated successfully"
55
+ else
56
+ echo "GitHub App token generation failed - will use GITHUB_TOKEN"
57
+ fi
58
+ echo "================================="
59
+
41
60
- name : Check out code
42
61
uses : actions/checkout@v4
43
62
with :
44
63
fetch-depth : 0
45
- # Use the GitHub App token
46
- token : ${{ steps.generate-token.outputs.token }}
64
+ # Use the GitHub App token if available, otherwise fallback to GITHUB_TOKEN
65
+ token : ${{ steps.generate-token.outputs.token || secrets.GITHUB_TOKEN }}
47
66
48
67
- name : Check if docs changed
49
68
id : docs-changed
@@ -118,7 +137,7 @@ jobs:
118
137
(github.event_name == 'issue_comment' && steps.pr-info.outputs.has_docs_changes == 'true'))
119
138
uses : actions/github-script@v7
120
139
with :
121
- github-token : ${{ secrets.CLA_BOT_TOKEN }}
140
+ github-token : ${{ steps.generate-token.outputs.token || secrets.GITHUB_TOKEN }}
122
141
script : |
123
142
let prNumber, prAuthor;
124
143
@@ -248,7 +267,7 @@ jobs:
248
267
(github.event_name == 'issue_comment' && steps.pr-info.outputs.has_docs_changes == 'true'))
249
268
uses : actions/github-script@v7
250
269
with :
251
- github-token : ${{ secrets.CLA_BOT_TOKEN }}
270
+ github-token : ${{ steps.generate-token.outputs.token || secrets.GITHUB_TOKEN }}
252
271
script : |
253
272
let prNumber, prHeadSha, prAuthor;
254
273
0 commit comments