Skip to content

Commit 9867da8

Browse files
committed
fix: harden GitHub Actions workflows
- pin all actions to full-length commit SHAs to prevent tag mutation attacks - add top-level permissions blocks to restrict default token scope
1 parent 10a82e6 commit 9867da8

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: ci
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
test:
710

@@ -13,9 +16,9 @@ jobs:
1316

1417
steps:
1518
- name: Checkout repo
16-
uses: actions/checkout@v2
19+
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
1720
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # v2
1922
with:
2023
python-version: ${{ matrix.python-version }}
2124
- name: Install requirements

.github/workflows/publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ on:
44
release:
55
types: [created]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
deploy:
912

1013
runs-on: ubuntu-latest
1114

1215
steps:
13-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
1417
- name: Set up Python
15-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@e9aba2c848f5ebd159c070c61ea2c4e2b122355e # v2
1619
with:
1720
python-version: '3.x'
1821
- name: Install dependencies

0 commit comments

Comments
 (0)