Skip to content

Commit 3c04e94

Browse files
authored
Merge pull request #32 from tacaswell/harden_gha
CI: Harden GHA configuration
2 parents ecfeed6 + a429996 commit 3c04e94

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

.github/workflows/docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Documentation
2+
permissions:
3+
contents: read
24

35
on: [push, pull_request]
46

@@ -14,6 +16,8 @@ jobs:
1416
steps:
1517

1618
- uses: actions/checkout@v2
19+
with:
20+
persist-credentials: false
1721

1822
- name: Set up Python ${{ matrix.python-version }}
1923
uses: actions/setup-python@v2

.github/workflows/flake8.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Check Code Style
2+
permissions:
3+
contents: read
24

35
on: [push, pull_request]
46

@@ -10,6 +12,8 @@ jobs:
1012
steps:
1113

1214
- uses: actions/checkout@v2
15+
with:
16+
persist-credentials: false
1317

1418
- uses: actions/setup-python@v2
1519

.github/workflows/publish-docs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ jobs:
2626
2727
- uses: actions/checkout@v2
2828
with:
29-
fetch-depth: 1000 # should be enough to reach the most recent tag
29+
fetch-depth: 1000
30+
persist-credentials: false
3031

3132
- name: Set up Python ${{ matrix.python-version }}
3233
uses: actions/setup-python@v2
@@ -51,7 +52,7 @@ jobs:
5152
- name: Deploy documentation
5253
# We pin to the SHA, not the tag, for security reasons.
5354
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
54-
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
55+
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3
5556
with:
5657
deploy_key: ${{ secrets.ACTIONS_DOCUMENTATION_DEPLOY_KEY }}
5758
publish_branch: master

.github/workflows/python-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v2
17+
with:
18+
persist-credentials: false
1719
- name: Set up Python
1820
uses: actions/setup-python@v2
1921
with:

.github/workflows/testing.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Unit Tests
2+
permissions:
3+
contents: read
24

35
on: [push, pull_request]
46

@@ -13,6 +15,8 @@ jobs:
1315

1416
steps:
1517
- uses: actions/checkout@v2
18+
with:
19+
persist-credentials: false
1620
- name: Set up Python ${{ matrix.python-version }}
1721
uses: actions/setup-python@v2
1822
with:

0 commit comments

Comments
 (0)