-
Notifications
You must be signed in to change notification settings - Fork 47
ci: use OIDC for codecov-action #2411
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: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,9 +1,9 @@ | ||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||
| - master | ||||||||||||||||||||||||||
| - master | ||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||
| - v* | ||||||||||||||||||||||||||
| - v* | ||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||
| merge_group: | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
@@ -26,4 +26,6 @@ jobs: | |||||||||||||||||||||||||
| - run: tox | ||||||||||||||||||||||||||
| - uses: codecov/codecov-action@v5 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| token: ${{ secrets.CODECOV_TOKEN }} | ||||||||||||||||||||||||||
| use_oidc: true | ||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||||||
|
Comment on lines
27
to
+31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/push.ymlRepository: deepmodeling/reacnetgenerator Length of output: 884 🌐 Web query:
💡 Result:
Citations:
🌐 Web query:
💡 Result:
permissions:
contents: readThis is the action’s documented “recommended permissions.” [1][2] Notes:
Add When 🛠️ Suggested fix permissions:
+ contents: read
id-token: write📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||
| on: | ||||||||||||
| push: | ||||||||||||
| branches: | ||||||||||||
| - master | ||||||||||||
| - master | ||||||||||||
|
Comment on lines
3
to
+4
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: In GitHub Actions, on:
push:
branches:
- main
- "releases/**"You can also use the inline (flow) list form: on:
push:
branches: [main, "releases/**"]Common gotchas:
Fix YAML list indentation for List items under 🛠️ Suggested fix on:
push:
branches:
- - master
+ - master📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| pull_request: | ||||||||||||
| merge_group: | ||||||||||||
|
|
||||||||||||
|
|
@@ -29,4 +29,6 @@ jobs: | |||||||||||
| - run: yarn coverage | ||||||||||||
| - uses: codecov/codecov-action@v5 | ||||||||||||
| with: | ||||||||||||
| token: ${{ secrets.CODECOV_TOKEN }} | ||||||||||||
| use_oidc: true | ||||||||||||
| permissions: | ||||||||||||
| id-token: write | ||||||||||||
|
Comment on lines
30
to
+34
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "testjs.yml" -type fRepository: deepmodeling/reacnetgenerator Length of output: 103 🌐 Web query:
💡 Result:
permissions:
contents: read[1] Why you can “lose” that permission: as soon as you set a Notes:
Common fix when you already have a permissions block: permissions:
contents: read
# keep your other scopes here...Or, if you lock down globally, re-enable only on the job that checks out: permissions: {}
jobs:
build:
permissions:
contents: read
steps:
- uses: actions/checkout@v6Sources: actions/checkout README/Marketplace [1], GitHub “workflow syntax” permissions behavior [2], GitHub repo/org default workflow permissions setting [3], GitHub changelog on permissions defaults/unspecified=none [4]. 🏁 Script executed: cat -n .github/workflows/testjs.ymlRepository: deepmodeling/reacnetgenerator Length of output: 1023 Add The workflow uses 🛠️ Suggested fix permissions:
+ contents: read
id-token: write🤖 Prompt for AI Agents |
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
GitHub Actions workflow YAML on.push branches tags list indentation syntax💡 Result:
In a GitHub Actions workflow,
branchesandtagsunderon: push:are YAML sequences (lists), so each pattern is a-item indented under the key:Key points:
on→push→branches/tagsare nested mappings, so indentation must reflect that nesting. GitHub’s docs showbranches:andtags:as lists underpush:. [1]branches/branches-ignoreandtags/tags-ignore(but not both of each pair for the same event). [2]branches(and notags), the workflow runs for branch pushes and not tag pushes; similarly, only definingtagsmakes it run only for tag pushes. [2]Alternative inline-list form (same meaning, just different YAML style):
Sources: GitHub Docs on
pushfilters and examples. [1] [2]🏁 Script executed:
cat -n .github/workflows/push.yml | head -40Repository: deepmodeling/reacnetgenerator
Length of output: 884
Fix YAML list indentation for
branches/tags.List items must be indented under their parent key. GitHub Actions documentation shows the correct format with list items indented 2 spaces further than their parent keys.
🛠️ Suggested fix
on: push: branches: - - master + - master tags: - - v* + - v*📝 Committable suggestion
🤖 Prompt for AI Agents