Skip to content

Commit d16c697

Browse files
committed
ci: pin actions workflow step hashes and use minimum permissions
1 parent 9230af9 commit d16c697

2 files changed

Lines changed: 34 additions & 30 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: CI Build
33

44
on:
55
push:
6-
branches: [ main, v2 ]
6+
branches:
7+
- main
8+
- v2
79
pull_request:
810

911
jobs:
@@ -13,25 +15,29 @@ jobs:
1315
timeout-minutes: 5
1416
strategy:
1517
matrix:
16-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
18+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
19+
permissions:
20+
contents: read
1721
steps:
18-
- uses: actions/checkout@v4
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
- name: Install dependencies
24-
run: |
25-
pip install -U pip
26-
pip install -e .
27-
pip install -r requirements-dev.txt
28-
- name: Run all tests
29-
run: |
30-
python_version=`python -V`
31-
if [ ${python_version:7:3} == "3.12" ]; then
32-
pip install -U flake8
33-
flake8 slackeventsapi
34-
pytest --cov-report= --cov=slackeventsapi tests && bash <(curl -s https://codecov.io/bash)
35-
else
36-
pytest tests
37-
fi
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install dependencies
30+
run: |
31+
pip install -U pip
32+
pip install -e .
33+
pip install -r requirements-dev.txt
34+
- name: Run all tests
35+
run: |
36+
python_version=`python -V`
37+
if [ ${python_version:7:3} == "3.12" ]; then
38+
pip install -U flake8
39+
flake8 slackeventsapi
40+
pytest --cov-report= --cov=slackeventsapi tests && bash <(curl -s https://codecov.io/bash)
41+
else
42+
pytest tests
43+
fi

.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 * * 0'
11-
12-
permissions:
13-
issues: write
14-
pull-requests: write
10+
- cron: "0 0 * * 0"
1511

1612
jobs:
1713
stale:
1814
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
pull-requests: write
1918
steps:
20-
- uses: actions/stale@v4.0.0
19+
- uses: actions/stale@cdf15f641adb27a71842045a94023bef6945e3aa # v4.0.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)