Skip to content

Commit 6a09260

Browse files
Jefffreyalamb
andauthored
Fix some GH action permission issues identified by CodeQL (#21838)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> N/A ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> <img width="302" height="45" alt="image" src="https://github.com/user-attachments/assets/fed0ded5-5ef5-4e10-9bd6-bb3391470ee7" /> Lets work on getting this number down to 0 ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> Fix some permissions to be minimum required in GH action workflows ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> All affected workflows were run on this commit: 48ffe3f - Since some workflows trigger on certain changes only - large files successful: https://github.com/apache/datafusion/actions/runs/24923629680/job/72989644694?pr=21838 - docs pr successful: https://github.com/apache/datafusion/actions/runs/24923629679/job/72989644704?pr=21838 - dependencies: - circular check successful: https://github.com/apache/datafusion/actions/runs/24923629662/job/72989644657?pr=21838 - unused check successful: https://github.com/apache/datafusion/actions/runs/24923629662/job/72989644656?pr=21838 - audit successful: https://github.com/apache/datafusion/actions/runs/24923629664/job/72989644667?pr=21838 - dev: - license check successful: https://github.com/apache/datafusion/actions/runs/24923629678/job/72989644714?pr=21838 - prettier successful: https://github.com/apache/datafusion/actions/runs/24923629678/job/72989644708?pr=21838 - asf yaml check successful: https://github.com/apache/datafusion/actions/runs/24923629678/job/72989644706?pr=21838 - typos successful: https://github.com/apache/datafusion/actions/runs/24923629678/job/72989644701?pr=21838 ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. --> --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
1 parent 310dd5d commit 6a09260

5 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/audit.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ on:
3333
paths:
3434
- "**/Cargo.toml"
3535
- "**/Cargo.lock"
36-
36+
3737
merge_group:
3838

39+
permissions:
40+
contents: read
41+
3942
jobs:
4043
security_audit:
4144
runs-on: ubuntu-latest

.github/workflows/dependencies.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ on:
3737
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
3838
workflow_dispatch:
3939

40+
permissions:
41+
contents: read
42+
4043
jobs:
4144
depcheck:
4245
name: circular dependency check

.github/workflows/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8686
with:
8787
persist-credentials: false
88-
# Version fixed on purpose. It uses heuristics to detect typos, so upgrading
88+
# Version fixed on purpose. It uses heuristics to detect typos, so upgrading
8989
# it may cause checks to fail more often.
9090
# We can upgrade it manually once a while.
9191
- name: Install typos-cli

.github/workflows/docs_pr.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ on:
3333
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
3434
workflow_dispatch:
3535

36+
permissions:
37+
contents: read
38+
3639
jobs:
37-
3840
# Test doc build
3941
linux-test-doc-build:
4042
name: Test doc build

.github/workflows/large_files.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ on:
2525
pull_request:
2626
merge_group:
2727

28+
permissions:
29+
contents: read
30+
2831
jobs:
2932
check-files:
3033
runs-on: ubuntu-slim

0 commit comments

Comments
 (0)