Skip to content

Commit 3ab4638

Browse files
authored
ci: pin actions workflow step hashes and use minimum permissions (#1691)
1 parent 81d10be commit 3ab4638

File tree

4 files changed

+31
-20
lines changed

4 files changed

+31
-20
lines changed

.github/workflows/ci-build.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: CI Build
33

44
on:
55
push:
6-
branches: [main]
6+
branches:
7+
- main
78
pull_request:
89

910
jobs:
@@ -22,13 +23,17 @@ jobs:
2223
- "3.8"
2324
- "3.7"
2425
- "pypy3.10"
26+
permissions:
27+
contents: read
2528
env:
2629
CI_LARGE_SOCKET_MODE_PAYLOAD_TESTING_DISABLED: "1"
2730
FORCE_COLOR: "1"
2831
steps:
29-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
with:
34+
persist-credentials: false
3035
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v5
36+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3237
with:
3338
python-version: ${{ matrix.python-version }}
3439
cache: pip
@@ -50,15 +55,15 @@ jobs:
5055
PYTHONPATH=$PWD:$PYTHONPATH pytest tests/slack_sdk/oauth/state_store/test_sqlalchemy.py
5156
- name: Upload test results to Codecov
5257
if: ${{ !cancelled() }}
53-
uses: codecov/test-results-action@v1
58+
uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0
5459
with:
5560
directory: ./reports/
5661
flags: ${{ matrix.python-version }}
5762
token: ${{ secrets.CODECOV_TOKEN }}
5863
verbose: true
5964
- name: Upload test coverage to Codecov (only with latest supported version)
6065
if: startsWith(matrix.python-version, '3.13')
61-
uses: codecov/codecov-action@v5
66+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
6267
with:
6368
token: ${{ secrets.CODECOV_TOKEN }}
6469
# Run validation generates the coverage file

.github/workflows/docs-deploy.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ jobs:
1717
build:
1818
name: Build Docusaurus
1919
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
2022
steps:
21-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2224
with:
2325
fetch-depth: 0
24-
- uses: actions/setup-node@v4
26+
persist-credentials: false
27+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2528
with:
2629
node-version: 20
2730
cache: npm
@@ -36,7 +39,7 @@ jobs:
3639
working-directory: ./docs
3740

3841
- name: Upload Build Artifact
39-
uses: actions/upload-pages-artifact@v3
42+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
4043
with:
4144
path: ./docs/build
4245

@@ -59,4 +62,4 @@ jobs:
5962
steps:
6063
- name: Deploy to GitHub Pages
6164
id: deployment
62-
uses: actions/deploy-pages@v4
65+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/mypy.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: 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.13"]
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/triage-issues.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44

55
name: Close stale issues and PRs
66

7-
on:
7+
on:
88
workflow_dispatch:
99
schedule:
10-
- cron: '0 0 * * 1'
11-
12-
permissions:
13-
issues: write
14-
pull-requests: write
10+
- cron: "0 0 * * 1"
1511

1612
jobs:
1713
stale:
1814
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
pull-requests: write
1918
steps:
20-
- uses: actions/[email protected]
19+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
2120
with:
2221
days-before-issue-stale: 30
2322
days-before-issue-close: 10
@@ -31,4 +30,3 @@ jobs:
3130
remove-stale-when-updated: true
3231
enable-statistics: true
3332
operations-per-run: 60
34-

0 commit comments

Comments
 (0)