Skip to content

Commit 8303120

Browse files
committed
security: Add permissions blocks to workflows, pin codecov action
- Add 'permissions: contents: read' to build.yml, lint.yml, test.yml - Add 'permissions: contents: write' to version.yml (needs write for tags) - Pin codecov/codecov-action to commit hash v4.5.0
1 parent c19790b commit 8303120

4 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- v*
1313
workflow_dispatch:
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
Build:
1720
runs-on: ${{ matrix.os }}

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
tags:
1212
- v*
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
lint-ruff:
1619
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313

1414
workflow_dispatch:
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
test_pip_install:
1821
runs-on: ubuntu-latest
@@ -157,7 +160,7 @@ jobs:
157160
pytest --cov=spicepy --cov-report=xml --cov-report=term-missing --ignore=tests/test_main.py tests/
158161
- name: Upload coverage to Codecov
159162
if: matrix.python-version == '3.12'
160-
uses: codecov/codecov-action@v4
163+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v4.5.0
161164
with:
162165
files: ./coverage.xml
163166
fail_ci_if_error: false

.github/workflows/version.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- 'setup.py'
99
workflow_dispatch:
1010

11+
permissions:
12+
contents: write
13+
1114
jobs:
1215
check-and-extract:
1316
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)