-
Notifications
You must be signed in to change notification settings - Fork 469
ci(GHA): Collect feature flag code references using flagsmith/ci #6590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
1f89bdf to
6c4c103
Compare
| uses: Flagsmith/ci/.github/workflows/collect-code-references.yml@feat/github-code-references-reusable-workflow | ||
| with: | ||
| flagsmith_project_id: 12 | ||
| flagsmith_admin_api_url: https://api.flagsmith.com | ||
| exclude_patterns: node_modules,venv,.git,cache,build,htmlcov,docs,.json,tests | ||
| secrets: | ||
| flagsmith_admin_api_key: ${{ secrets.FLAGSMITH_CODE_REFERENCES_API_KEY }} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 18 hours ago
In general, the fix is to add an explicit permissions block that scopes the GITHUB_TOKEN to the minimum required privileges. Since this job appears to only need to read the repository contents to collect code references, we can safely set contents: read. This block can be set at the workflow root (applies to all jobs) or on the specific job. The simplest, least invasive change is to add a root-level permissions block under name: and before on:.
Concretely, in .github/workflows/platform-collect-code-references.yml, add:
permissions:
contents: readat the top-level, between the existing name: and on: keys. This does not change existing behavior other than potentially reducing permissions if the default was broader, and it resolves the CodeQL alert by explicitly constraining GITHUB_TOKEN. No imports or additional definitions are needed.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: Collect code references | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| schedule: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6590 +/- ##
=======================================
Coverage 98.16% 98.16%
=======================================
Files 1295 1295
Lines 46793 46793
=======================================
Hits 45934 45934
Misses 859 859 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Our Code References feature is going GA! Starting with the GitHub integration.
Contributes to #5704.