Skip to content

fix(ci): grant security-fix job permissions in scheduled workflow#2099

Merged
samuv merged 1 commit intomainfrom
fix-security-agente-schedule
Apr 24, 2026
Merged

fix(ci): grant security-fix job permissions in scheduled workflow#2099
samuv merged 1 commit intomainfrom
fix-security-agente-schedule

Conversation

@samuv
Copy link
Copy Markdown
Collaborator

@samuv samuv commented Apr 24, 2026

Summary

  • Fix `Invalid workflow file` error on the scheduled security run caused by the top-level `permissions: contents: read` in `security-fix-cron.yml` capping the permissions of the reusable `_security-fix-agent.yml` workflow.
  • Grant the required permissions (`contents: write`, `pull-requests: write`, `issues: write`, `id-token: write`) explicitly on the `security-fix` job — same pattern already used in `on-main.yml` (fix(ci): grant security-fix job permissions in on-main workflow #2094).
  • The `security` job continues to inherit the safer `contents: read` default.

The failing workflow error was:

The nested job 'remediate' is requesting 'contents: write, issues: write, pull-requests: write, id-token: write', but is only allowed 'contents: read,

Copilot AI review requested due to automatic review settings April 24, 2026 08:10
@samuv samuv self-assigned this Apr 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the scheduled “Security Fix” GitHub Actions workflow failing with Invalid workflow file by ensuring the security-fix job has sufficient permissions when invoking the reusable _security-fix-agent.yml workflow (matching the established pattern in on-main.yml).

Changes:

  • Adds explicit job-level permissions (contents, pull-requests, issues, id-token: write) to the scheduled security-fix job.
  • Keeps the workflow’s top-level default permission at contents: read so the security job remains least-privileged.

@samuv samuv merged commit 8c2464a into main Apr 24, 2026
21 checks passed
@samuv samuv deleted the fix-security-agente-schedule branch April 24, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants