fixed startup failure in CI#134
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdded a job that, for PR-linked issue comments containing Changes
Sequence DiagramsequenceDiagram
actor GitHub
participant IssueComment as IssueComment Event
participant Fetch as fetch-pr-meta
participant REST as GitHub REST API
participant Process as process-response
participant Reusable as reusable-process-response.yml
GitHub->>IssueComment: deliver issue_comment (contains "discord:" / "Discord:")
IssueComment->>Fetch: trigger fetch-pr-meta (extract PR number)
Fetch->>REST: github.rest.pulls.get(pr_number)
REST-->>Fetch: returns {user.login, title, additions, deletions}
Fetch->>Fetch: compute lines_changed = additions + deletions
Fetch-->>Process: outputs pr_author, pr_title, lines_changed
Process->>Reusable: invoke reusable workflow with PR metadata
Reusable-->>Process: completes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can suggest fixes for GitHub Check annotations.Configure the |
|
Have you tested it in a fork, if it is working now? |
I haven't will test and update here |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/contributor-onboarding.yml:
- Around line 11-15: The workflow-level permission grant currently includes
"contents: write" which is overly broad for a read-only metadata job; remove
"contents: write" from the top-level permissions block and instead add scoped
permissions to individual jobs (e.g., add "contents: write" only to the
request-info or process-response jobs if they actually need it) while keeping
fetch-pr-meta limited to the minimum (pulls: read or pulls: write as required)
so that fetch-pr-meta performs only pulls.get without workflow-wide repo-content
write access.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1211f505-a856-4205-adbf-1b1620b2fb9d
📒 Files selected for processing (1)
.github/workflows/contributor-onboarding.yml
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/contributor-onboarding.yml (1)
11-14:⚠️ Potential issue | 🟠 MajorScope down GITHUB_TOKEN permissions for the metadata path.
contents: writeat workflow scope is broader than needed forfetch-pr-meta(read-only PR lookup). Move permissions to job scope and keepfetch-pr-metaminimal.🔒 Proposed least-privilege adjustment
permissions: pull-requests: write issues: write - contents: write jobs: request-info: + permissions: + pull-requests: write + issues: write + contents: write if: | github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'first-time-contributor') fetch-pr-meta: + permissions: + pull-requests: read if: | github.event_name == 'issue_comment' && github.event.issue.pull_request != null && (contains(github.event.comment.body, 'discord:') || contains(github.event.comment.body, 'Discord:'))Also applies to: 31-43
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/contributor-onboarding.yml around lines 11 - 14, The workflow currently grants broad repo-level permissions (e.g., contents: write) but the fetch-pr-meta job only needs read-only access; update the global permissions to remove contents: write and instead scope minimal permissions on the fetch-pr-meta job by adding a job-level permissions block that sets contents: read (and pull-requests: read, issues: read) for the fetch-pr-meta job, leaving other jobs to have their own scoped permissions as needed; locate the global permissions entries (permissions: pull-requests, issues, contents) and the job named fetch-pr-meta to apply this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.github/workflows/contributor-onboarding.yml:
- Around line 11-14: The workflow currently grants broad repo-level permissions
(e.g., contents: write) but the fetch-pr-meta job only needs read-only access;
update the global permissions to remove contents: write and instead scope
minimal permissions on the fetch-pr-meta job by adding a job-level permissions
block that sets contents: read (and pull-requests: read, issues: read) for the
fetch-pr-meta job, leaving other jobs to have their own scoped permissions as
needed; locate the global permissions entries (permissions: pull-requests,
issues, contents) and the job named fetch-pr-meta to apply this change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6d091bdd-fd15-4895-8a8d-8df7042f9954
📒 Files selected for processing (1)
.github/workflows/contributor-onboarding.yml
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/contributor-onboarding.yml (1)
30-55: 🧹 Nitpick | 🔵 TrivialConsider adding explicit read-only permissions to
fetch-pr-meta.This job only performs a
pulls.getread operation but inheritspull-requests: writefrom the workflow-level permissions. Adding explicit job-level permissions would follow least-privilege.🔒 Optional: Narrow token scope
fetch-pr-meta: + permissions: + pull-requests: read if: |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/contributor-onboarding.yml around lines 30 - 55, The fetch-pr-meta job currently inherits broad write permissions; add an explicit job-level permissions block to limit the token to read-only for pull data (e.g., add permissions: pulls: read) so the github.rest.pulls.get call in the meta step still works while following least-privilege; place the permissions key directly under the fetch-pr-meta job definition to override workflow-level write access.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/contributor-onboarding.yml:
- Line 69: The pr_number input is inconsistently quoted: update the pr_number
declaration at the location using pr_number: "${{ github.event.issue.number }}"
to match the other usage (or vice versa) so both use the same style; locate the
pr_number key in the workflow and either remove the surrounding double quotes or
add them to the other pr_number occurrence to ensure consistent quoting across
the workflow.
---
Duplicate comments:
In @.github/workflows/contributor-onboarding.yml:
- Around line 30-55: The fetch-pr-meta job currently inherits broad write
permissions; add an explicit job-level permissions block to limit the token to
read-only for pull data (e.g., add permissions: pulls: read) so the
github.rest.pulls.get call in the meta step still works while following
least-privilege; place the permissions key directly under the fetch-pr-meta job
definition to override workflow-level write access.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 99bd25e9-1098-4ae7-ab1a-2e882173c8ac
📒 Files selected for processing (2)
.github/workflows/contributor-onboarding.yml.github/workflows/track-contributor-prs.yml
93b2ac9 to
aa1510d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/track-contributor-prs.yml:
- Line 21: The workflow currently uses an invalid expression to set
lines_changed: `${{ github.event.pull_request.additions +
github.event.pull_request.deletions }}`; replace this by computing the sum in a
prior step (e.g., a step called compute-lines-changed) that reads
github.event.pull_request.additions and .deletions, adds them (in a shell or
JavaScript action), and sets the result as an output (e.g.,
outputs.lines_changed); then reference that output when calling the reusable
workflow (e.g., with: lines_changed: ${{
steps.compute-lines-changed.outputs.lines_changed }}). Ensure the step name and
output key match the call.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: fa991dff-3391-4169-8153-1e6a92f199ef
📒 Files selected for processing (2)
.github/workflows/contributor-onboarding.yml.github/workflows/track-contributor-prs.yml
c076899 to
bf253b3
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/track-contributor-prs.yml (1)
28-37:⚠️ Potential issue | 🟠 MajorAdd explicit
permissionsto the reusable-workflow call job.The
update-pr-countjob calls a reusable workflow without job-levelpermissions. Per GitHub Actions semantics, when a calling job omitspermissions, the reusable workflow receives the repository's default GITHUB_TOKEN permissions—bypassing the workflow-levelpull-requests: readrestriction defined at the top of this file. The reusable workflow can only preserve or reduce permissions from the caller's envelope, not escalate beyond it. Setting job-level permissions ensures the called workflow respects the intended least-privilege policy.Suggested fix
update-pr-count: needs: calculate-changes if: github.event.pull_request.merged == true + permissions: + pull-requests: read uses: StabilityNexus/ContributorAutomation/.github/workflows/reusable-update-pr.yml@main with: pr_number: ${{ github.event.pull_request.number }} repo_name: ${{ github.repository }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/track-contributor-prs.yml around lines 28 - 37, The reusable-job update-pr-count currently invokes StabilityNexus/ContributorAutomation/.github/workflows/reusable-update-pr.yml@main without an explicit job-level permissions block; add a permissions section to the update-pr-count job (e.g., permissions: pull-requests: read) so the called reusable workflow cannot inherit broader default GITHUB_TOKEN privileges and will respect the workflow-level least-privilege policy.
♻️ Duplicate comments (1)
.github/workflows/contributor-onboarding.yml (1)
30-35:⚠️ Potential issue | 🟠 MajorLimit
fetch-pr-metato a read-only token.This job only reads PR metadata via
pulls.get, but it currently inherits workflow-levelpull-requests: writeandissues: write. GitHub recommends granting the least requiredGITHUB_TOKENaccess, and once a job-levelpermissionsblock is set, any unspecified scopes drop tonone, sopull-requests: readis sufficient here. (docs.github.com)🔒 Proposed fix
fetch-pr-meta: + permissions: + pull-requests: read if: | github.event_name == 'issue_comment' && github.event.issue.pull_request != null &&🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/contributor-onboarding.yml around lines 30 - 35, The fetch-pr-meta job is inheriting write-level workflow permissions but only needs read access; add a job-level permissions block to restrict GITHUB_TOKEN to the least privileges required (e.g., set permissions: pull-requests: read and issues: read) in the fetch-pr-meta job definition so that other scopes drop to none and only read access is granted for pulls.get and reading issue/comment metadata.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In @.github/workflows/track-contributor-prs.yml:
- Around line 28-37: The reusable-job update-pr-count currently invokes
StabilityNexus/ContributorAutomation/.github/workflows/reusable-update-pr.yml@main
without an explicit job-level permissions block; add a permissions section to
the update-pr-count job (e.g., permissions: pull-requests: read) so the called
reusable workflow cannot inherit broader default GITHUB_TOKEN privileges and
will respect the workflow-level least-privilege policy.
---
Duplicate comments:
In @.github/workflows/contributor-onboarding.yml:
- Around line 30-35: The fetch-pr-meta job is inheriting write-level workflow
permissions but only needs read access; add a job-level permissions block to
restrict GITHUB_TOKEN to the least privileges required (e.g., set permissions:
pull-requests: read and issues: read) in the fetch-pr-meta job definition so
that other scopes drop to none and only read access is granted for pulls.get and
reading issue/comment metadata.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: dacb8c0a-837d-4c12-919a-c0bd52d21aa1
📒 Files selected for processing (2)
.github/workflows/contributor-onboarding.yml.github/workflows/track-contributor-prs.yml
|
test |
Addressed Issues:
Fixes #133
Screenshots/Recordings:
N/A
Additional Notes:
fetch-pr-metajob (issue_comment path) to fetch PR metadata from GitHub API:pr_authorpr_titlelines_changed(additions + deletions)process-responseto:fetch-pr-metavianeedspr_authorpr_titlelines_changedprocess-responsecall:comment_bodycommenterChecklist
AI Usage Disclosure
Check one of the checkboxes below:
I have used the following AI models and tools: Gemini to learn about CI/CD
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.
Summary by CodeRabbit