-
Notifications
You must be signed in to change notification settings - Fork 468
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6590 +/- ##
=======================================
Coverage 98.18% 98.18%
=======================================
Files 1295 1295
Lines 46920 46920
=======================================
Hits 46067 46067
Misses 853 853 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1ebf6e0 to
629c325
Compare
629c325 to
dc70900
Compare
dc70900 to
4280409
Compare
270009f to
2cbe52c
Compare
2cbe52c to
05895a1
Compare
05895a1 to
aebbcd0
Compare
| name: Collect | ||
| 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 3 days ago
In general, the fix is to explicitly declare a permissions block that restricts the GITHUB_TOKEN to the minimal scopes required. This can be done at the workflow root (applies to all jobs) or at the job level (for a specific job). Since this workflow only defines a single job, either is acceptable; using a workflow-level permissions is concise and clearly documents expectations for any future jobs added.
The safest change without altering existing behavior is to add a root-level permissions block just after the on: section, using read-only repository contents access as a baseline: contents: read. If the reusable workflow requires additional scopes (e.g., pull-requests: write), they can be added there, but we should not assume that from the snippet. Concretely, edit .github/workflows/platform-collect-code-references.yml to insert:
permissions:
contents: readbetween the on: block (lines 3–7) and the jobs: key (line 9). No imports or additional definitions are needed; this is purely a YAML configuration change.
-
Copy modified lines R9-R11
| @@ -6,6 +6,9 @@ | ||
| workflow_dispatch: | ||
| pull_request: # DROPME | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| collect-code-references: | ||
| name: Collect |
aebbcd0 to
43db6aa
Compare
Our Code References feature is going GA! Starting with the GitHub integration.
Contributes to #5704.
TODO: