|
11 | 11 | jobs: |
12 | 12 | preview: |
13 | 13 | runs-on: "runs-on=${{ github.run_id }}/family=g4dn.2xlarge/image=quantecon_ubuntu2404/disk=large" |
| 14 | + env: |
| 15 | + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
| 16 | + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |
14 | 17 | steps: |
15 | 18 | - uses: actions/checkout@v5 |
16 | 19 | with: |
|
57 | 60 | mkdir -p _build/html/_notebooks |
58 | 61 | cp -u _build/jupyter/*.ipynb _build/html/_notebooks |
59 | 62 | - name: Upload Execution Reports (Download Notebooks) |
60 | | - uses: actions/upload-artifact@v4 |
| 63 | + uses: actions/upload-artifact@v5 |
61 | 64 | if: failure() |
62 | 65 | with: |
63 | 66 | name: execution-reports-notebooks |
|
69 | 72 | mkdir -p _build/html/_pdf |
70 | 73 | cp -u _build/latex/*.pdf _build/html/_pdf |
71 | 74 | - name: Upload Execution Reports (LaTeX) |
72 | | - uses: actions/upload-artifact@v4 |
| 75 | + uses: actions/upload-artifact@v5 |
73 | 76 | if: failure() |
74 | 77 | with: |
75 | 78 | name: execution-reports |
|
80 | 83 | run: | |
81 | 84 | jb build lectures --path-output ./ -n -W --keep-going |
82 | 85 | - name: Upload Execution Reports (HTML) |
83 | | - uses: actions/upload-artifact@v4 |
| 86 | + uses: actions/upload-artifact@v5 |
84 | 87 | if: failure() |
85 | 88 | with: |
86 | 89 | name: execution-reports |
@@ -168,6 +171,11 @@ jobs: |
168 | 171 | fi |
169 | 172 | - name: Preview Deploy to Netlify |
170 | 173 | id: netlify-deploy |
| 174 | + if: > |
| 175 | + github.actor != 'dependabot[bot]' && |
| 176 | + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && |
| 177 | + env.NETLIFY_AUTH_TOKEN != '' && |
| 178 | + env.NETLIFY_SITE_ID != '' |
171 | 179 | shell: bash -l {0} |
172 | 180 | run: | |
173 | 181 | if [ "${{ github.event_name }}" = "pull_request" ]; then |
@@ -238,11 +246,16 @@ jobs: |
238 | 246 | echo "🎯 Preview page: ${deploy_url}/${{ github.event.inputs.preview_page }}" |
239 | 247 | fi |
240 | 248 | fi |
241 | | - env: |
242 | | - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
243 | | - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |
| 249 | + - name: Skip Netlify Deploy (no secrets or untrusted actor) |
| 250 | + if: > |
| 251 | + !(github.actor != 'dependabot[bot]' && |
| 252 | + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) && |
| 253 | + env.NETLIFY_AUTH_TOKEN != '' && |
| 254 | + env.NETLIFY_SITE_ID != '') |
| 255 | + run: | |
| 256 | + echo "Skipping Netlify preview deploy: secrets unavailable or actor not trusted (actor=${{ github.actor }})" |
244 | 257 | - name: Post PR Comment with Preview Links |
245 | | - if: github.event_name == 'pull_request' |
| 258 | + if: github.event_name == 'pull_request' && steps.netlify-deploy.outputs.deploy_url != '' |
246 | 259 | uses: actions/github-script@v7 |
247 | 260 | with: |
248 | 261 | script: | |
|
0 commit comments