Skip to content

Commit 6c4d1ef

Browse files
authored
ci: pin actions workflow step hashes and use minimum permissions (#58)
1 parent 04f3c33 commit 6c4d1ef

File tree

6 files changed

+49
-23
lines changed

6 files changed

+49
-23
lines changed

.github/workflows/codecov.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@ name: Run codecov
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
910
run:
1011
runs-on: ubuntu-latest
1112
timeout-minutes: 5
13+
permissions:
14+
contents: read
1215
steps:
13-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
persist-credentials: false
1419
- name: Set up Python
15-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1621
with:
1722
python-version: 3.12
1823
- name: Install dependencies
@@ -24,7 +29,7 @@ jobs:
2429
run: |
2530
pytest --cov=./slack_cli_hooks/ --cov-report=xml
2631
- name: Upload coverage to Codecov
27-
uses: codecov/codecov-action@v5
32+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
2833
with:
2934
token: ${{ secrets.CODECOV_TOKEN }}
3035
fail_ci_if_error: true
@@ -38,9 +43,11 @@ jobs:
3843
timeout-minutes: 5
3944
steps:
4045
- name: Setup repo
41-
uses: actions/checkout@v4
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
persist-credentials: false
4249
- name: Report health score
43-
uses: slackapi/slack-health-score@v0
50+
uses: slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1
4451
with:
4552
codecov_token: ${{ secrets.FILS_CODECOV_API_TOKEN }}
4653
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/flake8.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Run flake8 validation
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -12,10 +13,14 @@ jobs:
1213
strategy:
1314
matrix:
1415
python-version: ["3.12"]
16+
permissions:
17+
contents: read
1518
steps:
16-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
1722
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1924
with:
2025
python-version: ${{ matrix.python-version }}
2126
- name: Run flake8 verification

.github/workflows/mypy.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Run mypy validation
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -12,10 +13,14 @@ jobs:
1213
strategy:
1314
matrix:
1415
python-version: ["3.12"]
16+
permissions:
17+
contents: read
1518
steps:
16-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
1722
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1924
with:
2025
python-version: ${{ matrix.python-version }}
2126
- name: Run mypy verification

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@ name: Upload A Release To Pypi
22

33
on:
44
release:
5-
types: [published]
5+
types:
6+
- published
67

78
jobs:
89
deploy:
910
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
1013
steps:
11-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
with:
16+
persist-credentials: false
1217
- name: Set up Python
13-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1419
with:
1520
python-version: "3.x"
1621
- name: Install dependencies

.github/workflows/tests.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Run all the unit tests
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
67
pull_request:
78

89
jobs:
@@ -12,10 +13,14 @@ jobs:
1213
strategy:
1314
matrix:
1415
python-version: ["3.9", "3.10", "3.11", "3.12", "pypy3.10"]
16+
permissions:
17+
contents: read
1518
steps:
16-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
1722
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1924
with:
2025
python-version: ${{ matrix.python-version }}
2126
- name: Install dependencies

.github/workflows/triage-issues.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ on:
99
schedule:
1010
- cron: "0 0 * * 1"
1111

12-
permissions:
13-
issues: write
14-
pull-requests: write
15-
1612
jobs:
1713
stale:
1814
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
pull-requests: write
1918
steps:
20-
- uses: actions/stale@v9
19+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
2120
with:
2221
days-before-issue-stale: 30
2322
days-before-issue-close: 10

0 commit comments

Comments
 (0)