Skip to content
Open
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
37 changes: 37 additions & 0 deletions .github/workflows/preflight.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Preflight

on:
pull_request:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Because this workflow runs on pull_request when preflight.yml itself changes, the workflow definition from the PR branch can be executed; please double-check that this can’t be used to run newly-added steps with elevated job permissions (notably id-token: write / pull-requests: write). If this is intended only as a self-test trigger, consider ensuring the pull_request path is effectively non-privileged for untrusted changes.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

paths:
- ".github/workflows/preflight.yml"
pull_request_target:
types: [opened, synchronize, reopened, edited]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale approvals job triggers unnecessarily on PR edits

Medium Severity

The edited activity type on pull_request_target fires when the PR title, body, or base branch changes. This is needed for the todo-comments job (which scans for Linear tickets from the PR title), but the stale-approvals and dependencies jobs also run on every title/body edit despite not needing to. The stale-approvals job holds pull-requests: write and id-token: write permissions and may dismiss approvals unnecessarily, while dependencies runs a pointless review. These two jobs lack an if condition (e.g., filtering on github.event.action != 'edited') to skip edited events.

Additional Locations (2)
Fix in Cursor Fix in Web

merge_group:

jobs:
stale-approvals:
name: Stale approvals
permissions:
actions: read
contents: read
# Required by the reusable workflow to extract job_workflow_ref from the
# OIDC token to resolve the correct checkout ref for the composite action.
# see: https://github.com/actions/toolkit/issues/1264
# TODO: Remove once $/ syntax is available
# see: https://github.com/orgs/community/discussions/26245#discussioncomment-15601440
id-token: write
pull-requests: write
uses: hashintel/.github/.github/workflows/dismiss-stale-approvals.yml@52c4a1f5fa1c72f30dfa02b00a6cbf0c89c1ea8a

dependencies:
name: Dependencies
permissions:
contents: read
pull-requests: write
uses: hashintel/.github/.github/workflows/dependencies.yml@52c4a1f5fa1c72f30dfa02b00a6cbf0c89c1ea8a

todo-comments:
name: Todo comments
permissions:
contents: read
uses: hashintel/.github/.github/workflows/todo-comments.yml@52c4a1f5fa1c72f30dfa02b00a6cbf0c89c1ea8a
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The called reusable workflow todo-comments.yml (in hashintel/.github) checks out github.event.pull_request.head.sha even when invoked via pull_request_target; since pull_request_target runs with a more privileged token, it’s worth confirming this job can’t be abused by a fork PR (e.g., by executing untrusted code from the checkout). If forks are in scope, consider restricting when this job runs or ensuring the reusable workflow never executes repository-provided code.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Loading