Skip to content

Commit 504c611

Browse files
authored
Merge pull request #166 from tacaswell/harden_gha
CI: Harden GHA configuration
2 parents f02ebb5 + f25b7af commit 504c611

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.github/workflows/main.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
name: CI
2-
32
on: [push, pull_request]
43

54
jobs:
65
pre-commit:
7-
runs-on: ubuntu-20.04
6+
permissions:
7+
contents: read
8+
9+
runs-on: ubuntu-latest
810
steps:
911
- uses: actions/checkout@v4
12+
with:
13+
persist-credentials: false
1014
- uses: actions/setup-python@v5
11-
- uses: pre-commit/[email protected]
15+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
1216
build:
13-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
1421
steps:
1522
- uses: actions/checkout@v4
23+
with:
24+
persist-credentials: false
1625
- uses: actions/setup-python@v5
1726
with:
1827
python-version: "3.10"
@@ -67,14 +76,9 @@ jobs:
6776
name: diffs
6877
path: |
6978
diffs/
70-
- name: Output artifacts URL
71-
run: |
72-
echo 'Artifact URL:' \
73-
'${{ steps.diffs-artifact-upload.outputs.artifact-url }}' \
74-
>> $GITHUB_STEP_SUMMARY
7579
- name: Publish cheatsheets and handouts
7680
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
77-
uses: peaceiris/actions-gh-pages@v4
81+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
7882
with:
7983
github_token: ${{ secrets.GITHUB_TOKEN }}
8084
publish_dir: ./docs/_build/html/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ repos:
1010
- id: end-of-file-fixer
1111
- id: trailing-whitespace
1212
- repo: https://github.com/pycqa/flake8
13-
rev: 4.0.1
13+
rev: 7.3.0
1414
hooks:
1515
- id: flake8

0 commit comments

Comments
 (0)