Skip to content

Commit 75ec373

Browse files
CI: run on push to main and set least-privilege GITHUB_TOKEN permissions (#546)
Add a push trigger on main so the full CI matrix (lint, unit, integration) re-runs on merge, matching dropbox-sdk-dotnet; previously ci.yml only ran on pull_request, so main could break undetected. Also add a top-level `permissions: contents: read` to ci.yml, coverage.yml, and spec_update.yml to satisfy the CodeQL missing-workflow-permissions alert. Jobs that need OIDC keep their job-level id-token: write override; spec_update creates PRs via the SPEC_UPDATE_TOKEN PAT, not GITHUB_TOKEN.
1 parent 0ab9517 commit 75ec373

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
name: CI
22
on:
3+
push:
4+
branches:
5+
- main
36
pull_request:
47

8+
permissions: # least privilege; jobs needing OIDC override this
9+
contents: read
10+
511
jobs:
612
CI:
713
runs-on: ${{ matrix.os }}

.github/workflows/coverage.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
schedule:
88
- cron: 0 0 * * *
99

10+
permissions: # least privilege; jobs needing OIDC override this
11+
contents: read
12+
1013
jobs:
1114
Coverage:
1215
runs-on: ubuntu-latest

.github/workflows/spec_update.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
repository_dispatch:
55
types: [spec_update]
66

7+
permissions: # least privilege; PR creation uses the SPEC_UPDATE_TOKEN PAT
8+
contents: read
9+
710
jobs:
811
Update:
912
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)