Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

# The build lives in build-xm.yml on the openipc branch (the default
# branch, so it can be dispatched). GitHub runs a pull request's
# workflows from the PR's own tree, so this branch needs this caller for
# its pushes and pull requests to be built and smoke-tested at all.
# It never releases: that workflow only uploads on workflow_dispatch.
on:
push:
branches: [openipc-xm]
pull_request:
branches: [openipc-xm]

jobs:
build:
uses: OpenIPC/u-boot/.github/workflows/build-xm.yml@openipc
# github.sha: on pull_request the merge of the PR into the current
# base, so the PR is built as it would land; on push, that commit.
with:
ref: ${{ github.sha }}
# A called workflow is validated against what its caller grants,
# skipped jobs included; release/publish ask for these.
permissions:
contents: write
id-token: write
Comment on lines +23 to +25

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. Pull requests can request identity tokens 🐞 Bug ⛨ Security

The build job grants id-token: write and contents: write to the reusable workflow on both
push and pull_request events, although this caller does not dispatch a release. For a pull
request targeting openipc-xm, the called workflow has permission to request an identity token; the
stated upload guard does not restrict that permission.
Agent Prompt
## Issue description
The CI caller grants publish-level permissions to the reusable workflow during pull-request builds, even though this caller is not intended to publish.

## Fix Focus Areas
- .github/workflows/ci.yml[14-25]

## Recommended Fix
Separate the reusable workflow's build and publish paths so this caller can invoke the build path with read-only contents permission and without ID-token permission. Keep elevated permissions on the dispatch-only publishing path.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Loading