Skip to content

Commit a8b4007

Browse files
authored
ci: Update Github token permissions (#185)
# Summary Sets explicit permissions on `GITHUB_TOKEN`, to address the issues flagged by CodeQL scanner. # Changes * Permission set on each workflow. * Update status badges in README to include CodeQL.
1 parent 950f9dc commit a8b4007

6 files changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/benchmarks.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ on:
77
- synchronize
88

99
jobs:
10-
lint:
10+
benchmark:
1111
name: Benchmark tests
1212
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
pull-requests: write
1316
strategy:
1417
matrix:
1518
python_version: [3.12]

.github/workflows/docs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ env:
1616
jobs:
1717
publish:
1818
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
1921
steps:
2022
- name: checkout gh-pages
2123
uses: actions/checkout@v4

.github/workflows/lint-test.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- synchronize
1111
- reopened
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
lint:
1518
name: Lint code

.github/workflows/pr-check.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
jobs:
1212
pr-check:
1313
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: read
1416
steps:
1517
- name: Check PR title
1618
uses: amannn/action-semantic-pull-request@v5

.github/workflows/pypi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
env:
1010
PYTHON_VERSION: '3.12'
1111

12+
permissions:
13+
contents: read
14+
1215
# See https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
1316
# Uses https://github.com/astral-sh/uv/issues/6298#issuecomment-2335034247 to set version equivalent to poetry-dynamic-versioning
1417
jobs:

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,24 @@
88

99
<div align="center" class="badge-section">
1010
<br>
11-
<a href="https://pypi.org/project/plugboard/", alt="PyPI version">
11+
<a href="https://pypi.org/project/plugboard/" alt="PyPI version">
1212
<img alt="PyPI" src="https://img.shields.io/pypi/v/plugboard?labelColor=075D7A&color=CC9C4A"></a>
13-
<a href="https://www.python.org/", alt="Python versions">
13+
<a href="https://www.python.org/" alt="Python versions">
1414
<img alt="Python" src="https://img.shields.io/pypi/pyversions/plugboard?labelColor=075D7A&color=CC9C4A"></a>
15-
<a href="https://github.com/plugboard-dev/plugboard?tab=Apache-2.0-1-ov-file#readme", alt="License">
15+
<a href="https://github.com/plugboard-dev/plugboard?tab=Apache-2.0-1-ov-file#readme" alt="License">
1616
<img alt="License" src="https://img.shields.io/github/license/plugboard-dev/plugboard?labelColor=075D7A&color=CC9C4A"></a>
17-
<a href="https://github.com/plugboard-dev/plugboard", alt="Typed">
17+
<a href="https://github.com/plugboard-dev/plugboard" alt="Typed">
1818
<img alt="Typed" src="https://img.shields.io/pypi/types/plugboard?labelColor=075D7A&color=CC9C4A"></a>
1919
<br>
20-
<a href="https://github.com/plugboard-dev/plugboard/actions/workflows/lint-test.yaml", alt="Lint and test">
20+
<a href="https://github.com/plugboard-dev/plugboard/actions/workflows/lint-test.yaml" alt="Lint and test">
2121
<img alt="Lint and Test" src="https://github.com/plugboard-dev/plugboard/actions/workflows/lint-test.yaml/badge.svg"></a>
22-
<a href="https://github.com/plugboard-dev/plugboard/actions/workflows/docs.yaml", alt="Documentation">
23-
<img alt="Docs" src="https://github.com/plugboard-dev/plugboard/actions/workflows/docs.yaml/badge.svg"></a>
22+
<a href="https://github.com/plugboard-dev/plugboard/actions/workflows/github-code-scanning/codeql" alt="CodeQL">
23+
<img alt="CodeQL" src="https://github.com/plugboard-dev/plugboard/actions/workflows/github-code-scanning/codeql/badge.svg"></a>
2424
<a href="https://codecov.io/gh/plugboard-dev/plugboard" >
2525
<img src="https://codecov.io/gh/plugboard-dev/plugboard/graph/badge.svg?token=4LU4K6TOLQ"/></a>
26+
<br>
27+
<a href="https://docs.plugboard.dev" alt="Documentation">
28+
<img alt="Docs" src="https://github.com/plugboard-dev/plugboard/actions/workflows/docs.yaml/badge.svg"></a>
2629
</div>
2730

2831
<hr>

0 commit comments

Comments
 (0)