Skip to content

Commit 378d5ec

Browse files
committed
skip pushing out of default branch, skip linting on non-successes, set correct permissions, add run-id and auth to download artifact job
1 parent ee89d94 commit 378d5ec

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/lint.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ on: # zizmor: ignore[dangerous-triggers]
55
workflows: [update and build]
66
types: [completed]
77

8-
permissions: {}
9-
108
jobs:
119
lint:
10+
if: github.event.workflow_run.conclusion == 'success'
1211
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1314
strategy:
1415
fail-fast: false
1516
matrix:
@@ -28,7 +29,10 @@ jobs:
2829
- run: sphinx-lint
2930

3031
lint-epub:
32+
if: github.event.workflow_run.conclusion == 'success'
3133
runs-on: ubuntu-latest
34+
permissions:
35+
actions: read
3236
strategy:
3337
matrix:
3438
version: [3.15, 3.14]
@@ -41,4 +45,6 @@ jobs:
4145
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
4246
with:
4347
name: build-${{ matrix.version }}-epub
48+
run-id: ${{ github.event.workflow_run.id }}
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
4450
- run: uvx epubcheck

.github/workflows/update-and-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
if: env.SIGNIFICANT_CHANGES
6767
- name: Push commit
6868
uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0
69-
if: env.SIGNIFICANT_CHANGES
69+
if: env.SIGNIFICANT_CHANGES && (github.event.workflow_run.head_branch == github.event.repository.default_branch)
7070
with:
7171
branch: ${{ matrix.version }}
7272
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)