Skip to content

Commit 9d28e5f

Browse files
committed
ci: Use commit hashes to ensure reproducible builds; use read permissions
1 parent 2183946 commit 9d28e5f

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

.github/workflows/commit_checks.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ on:
77
- main
88
pull_request:
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
pre-commit:
1215
runs-on: ubuntu-latest
1316
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-python@v5
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1619
with:
1720
python-version: '3.12' # Specify a Python version explicitly
18-
- uses: pre-commit/[email protected]
21+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
1922

2023
test:
2124
name: test py${{ matrix.python-version }} on ${{ matrix.os }}
@@ -32,10 +35,10 @@ jobs:
3235
MJ_APIKEY_PUBLIC: ${{ secrets.MJ_APIKEY_PUBLIC }}
3336
MJ_APIKEY_PRIVATE: ${{ secrets.MJ_APIKEY_PRIVATE }}
3437
steps:
35-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3639
with:
3740
fetch-depth: 0 # Get full history with tags (required for setuptools-scm)
38-
- uses: conda-incubator/setup-miniconda@v3
41+
- uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
3942
with:
4043
python-version: ${{ matrix.python-version }}
4144
channels: defaults

.github/workflows/issue-triage.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ on:
44
issues:
55
types: [opened, labeled, unlabeled, reopened]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
triage:
912
runs-on: ubuntu-latest
1013
permissions:
1114
issues: write
1215
steps:
1316
- name: Initial triage
14-
uses: actions/github-script@v6
17+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
1518
with:
1619
github-token: ${{ secrets.GITHUB_TOKEN }}
1720
script: |

.github/workflows/pr_validation.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@ on:
44
pull_request:
55
branches: [main]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
validate:
912
runs-on: ubuntu-latest
1013
steps:
11-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1215
with:
1316
fetch-depth: 0
1417

1518
- name: Set up Python
16-
uses: actions/setup-python@v5
19+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1720
with:
1821
python-version: '3.12'
1922

2023
- name: Build package
2124
run: |
22-
pip install --upgrade build setuptools wheel setuptools-scm
25+
pip install --upgrade build setuptools setuptools-scm
2326
python -m build
2427
2528
- name: Test installation

.github/workflows/publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
types: [published] # Triggers when a GitHub release is published
88
workflow_dispatch: # Manual trigger
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
publish:
1215
runs-on: ubuntu-latest
@@ -15,17 +18,17 @@ jobs:
1518
contents: read
1619

1720
steps:
18-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1922
with:
2023
fetch-depth: 0
2124

2225
- name: Set up Python
23-
uses: actions/setup-python@v5
26+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2427
with:
2528
python-version: '3.12'
2629

2730
- name: Install build tools
28-
run: pip install --upgrade build setuptools wheel setuptools-scm twine
31+
run: pip install --upgrade build setuptools setuptools-scm twine
2932

3033
- name: Extract version
3134
id: get_version

0 commit comments

Comments
 (0)