Skip to content

Commit 53aa859

Browse files
authored
Merge pull request #102 from tacaswell/harden_gha
CI: Harden GHA configuration
2 parents 79f9e85 + 9ed6f03 commit 53aa859

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

.github/.github/workflows/lighthouse.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: Lighthouse
2+
permissions:
3+
contents: read
24
on: [push, pull_request]
35
jobs:
46
CI:
57
runs-on: ubuntu-latest
68
steps:
79
- uses: actions/checkout@v1
10+
with:
11+
persist-credentials: false
812

913
- name: Set up Python 3.7
1014
uses: actions/setup-python@v1
@@ -22,7 +26,7 @@ jobs:
2226
make html
2327
2428
- name: Run Lighthouse against example docs build
25-
uses: treosh/lighthouse-ci-action@v2
29+
uses: treosh/lighthouse-ci-action@005e1277a8a17ea0b0ef6c3332d59a7cd0f730ce # v2
2630
with:
2731
configPath: "./lighthouserc.json"
2832
temporaryPublicStorage: true

.github/.github/workflows/pre-commit.yaml

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

35
on:
46
push:
@@ -12,5 +14,7 @@ jobs:
1214
runs-on: ubuntu-latest
1315
steps:
1416
- uses: actions/checkout@v2
17+
with:
18+
persist-credentials: false
1519
- uses: actions/setup-python@v2
16-
- uses: pre-commit/[email protected]
20+
- uses: pre-commit/action@0764670bf370aab253130d534e1eda7ff497dc60 # v2.0.0

.github/.github/workflows/publish-pypi.yml

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

35
on:
46
push:
@@ -8,10 +10,15 @@ on:
810
jobs:
911
publish:
1012
runs-on: ubuntu-latest
11-
13+
permissions:
14+
id-token: write
15+
attestations: write
16+
contents: read
1217
steps:
1318
- name: Checkout
1419
uses: actions/checkout@v1
20+
with:
21+
persist-credentials: false
1522

1623
- name: Set up Python 3.7
1724
uses: actions/setup-python@v1
@@ -29,7 +36,7 @@ jobs:
2936
python setup.py sdist bdist_wheel
3037
3138
- name: Publish mpl-sphinx-theme
32-
uses: pypa/gh-action-pypi-publish@master
39+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
3340
with:
3441
user: __token__
3542
password: ${{ secrets.pypi_token }}

.github/.githubold/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
name: Run CircleCI artifacts redirector
66
steps:
77
- name: GitHub Action step
8-
uses: larsoner/circleci-artifacts-redirector-action@master
8+
uses: scientific-python/circleci-artifacts-redirector-action@7eafdb60666f57706a5525a2f5eb76224dc8779b # v1.1.0
99
with:
1010
repo-token: ${{ secrets.GITHUB_TOKEN }}
1111
artifact-path: 0/docs/_build/html/index.html

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/mpl_sphinx_theme.egg-info/
22
/mpl_sphinx_theme/__pycache__/
33
build
4+
dist

0 commit comments

Comments
 (0)