Skip to content

Commit 8c1d0a2

Browse files
committed
feat: update workflow permissions and enhance debug logging for auto_examples download
1 parent 9773e00 commit 8c1d0a2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/generate-examples.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626
permissions:
2727
actions: read # Required for downloading workflow artifacts
2828
contents: read # Required for checking out repository
29+
pull-requests: read # Required for PR operations
2930
id-token: write # Required for uploading artifacts
3031

3132
# Cancel previous runs if a new push happens
@@ -189,6 +190,9 @@ jobs:
189190
- name: Download latest auto_examples
190191
run: |
191192
echo "🔽 Downloading latest auto_examples as base..."
193+
echo "Debug: GITHUB_TOKEN is ${GITHUB_TOKEN:+set}${GITHUB_TOKEN:-unset}"
194+
echo "Debug: GH_TOKEN is ${GH_TOKEN:+set}${GH_TOKEN:-unset}"
195+
echo "Debug: GITHUB_ACTIONS is $GITHUB_ACTIONS"
192196
python scripts/download_auto_examples.py
193197
if [ -d "docs/auto_examples" ]; then
194198
echo "✅ Downloaded existing auto_examples"
@@ -199,7 +203,8 @@ jobs:
199203
echo "ℹ️ No existing auto_examples found, will build from scratch"
200204
fi
201205
env:
202-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
206+
GITHUB_TOKEN: ${{ github.token }}
207+
GH_TOKEN: ${{ github.token }}
203208

204209
- name: Get last successful workflow commit
205210
id: last-success
@@ -243,7 +248,7 @@ jobs:
243248
244249
echo "last_success_sha=$LAST_SUCCESS_SHA" >> $GITHUB_OUTPUT
245250
env:
246-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
251+
GH_TOKEN: ${{ github.token }}
247252

248253
- name: Detect changed example files
249254
id: changed-examples
@@ -438,7 +443,7 @@ jobs:
438443
if: github.event_name == 'release'
439444
uses: actions/upload-release-asset@v1
440445
env:
441-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
446+
GITHUB_TOKEN: ${{ github.token }}
442447
with:
443448
upload_url: ${{ github.event.release.upload_url }}
444449
asset_path: docs/auto_examples.zip

0 commit comments

Comments
 (0)