Skip to content

CI: run on push to main and set least-privilege workflow permissions#546

Merged
AndreyVMarkelov merged 1 commit into
mainfrom
ci/run-ci-on-push-to-main
Jul 15, 2026
Merged

CI: run on push to main and set least-privilege workflow permissions#546
AndreyVMarkelov merged 1 commit into
mainfrom
ci/run-ci-on-push-to-main

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Two related CI hardening fixes:

  1. Run CI on merge to main. ci.yml was triggered on pull_request only, so the full matrix (lint + unit + integration) never re-ran on the merge commit — main could break undetected (e.g. a PR green against a stale base, or two PRs that conflict only once both land). Add a push: [main] trigger, matching dropbox-sdk-dotnet's ci.yml.

  2. Set least-privilege GITHUB_TOKEN permissions. Resolves the CodeQL actions/missing-workflow-permissions alert (Feature request: batch upload/download files #5). Add a top-level permissions: contents: read to both ci.yml and coverage.yml. Jobs that use OIDC keep their existing job-level id-token: write override, so credential fetching is unaffected.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.19%. Comparing base (0ab9517) to head (4b10d97).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #546   +/-   ##
=======================================
  Coverage   65.19%   65.19%           
=======================================
  Files          34       34           
  Lines       65205    65205           
  Branches     4642     4642           
=======================================
  Hits        42508    42508           
  Misses      22536    22536           
  Partials      161      161           
Flag Coverage Δ
integration 65.04% <ø> (ø)
unit 64.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@AndreyVMarkelov
AndreyVMarkelov force-pushed the ci/run-ci-on-push-to-main branch from 6330b6e to 4b10d97 Compare July 15, 2026 23:11
@AndreyVMarkelov
AndreyVMarkelov merged commit 75ec373 into main Jul 15, 2026
32 checks passed
@AndreyVMarkelov
AndreyVMarkelov deleted the ci/run-ci-on-push-to-main branch July 15, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant