Skip to content
Open
Show file tree
Hide file tree
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
71 changes: 71 additions & 0 deletions .github/workflows/housekeeping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Housekeeping

on:
pull_request:
paths:
- ".github/workflows/housekeeping.yml"
- ".github/renovate.json"
schedule:
- cron: "0 */2 * * *"
workflow_dispatch:
inputs:
repoCache:
description: "Reset or disable the cache?"
type: choice
default: enabled
options:
- enabled
- disabled
- reset
logLevel:
description: "Override default log level"
type: choice
default: info
options:
- "debug"
- "info"
- "warn"
- "error"
overrideSchedule:
description: "Override all schedules"
type: boolean
default: false
dryRun:
description: "Dry run mode"
type: choice
default: disabled
options:
- disabled
- extract
- lookup
- full

permissions:
actions: read
contents: write
id-token: write

jobs:
validate:
name: Validate
if: github.event_name == 'pull_request'
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Validate Renovate config
run: jq empty .github/renovate.json

- name: Validate workflow
run: go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 .github/workflows/housekeeping.yml

renovate:
name: Dependencies
uses: hashintel/.github/.github/workflows/housekeeping-dependencies.yml@a0df113e5602f3b721bf306bf6050ee2a0866956
with:
repoCache: ${{ inputs.repoCache || 'enabled' }}
logLevel: ${{ inputs.logLevel || 'info' }}
overrideSchedule: ${{ inputs.overrideSchedule || false }}
dryRun: ${{ inputs.dryRun || 'disabled' }}
secrets: inherit
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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Preflight runs duplicate jobs on workflow changes

Medium Severity

On PRs that modify preflight.yml, both the pull_request (path-matched) and pull_request_target (synchronize/edited) events fire and execute all three reusable workflow jobs in parallel with no concurrency group or event guard. This produces simultaneous stale-approval dismissals, dependency reviews, and todo-comment scans. Fork PRs additionally lack pull-requests: write on the pull_request token, so those duplicate runs will surface as failing status checks.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3ab8415. Configure here.

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/preflight-stale-approvals.yml@a0df113e5602f3b721bf306bf6050ee2a0866956

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

todo-comments:
name: Todo comments
permissions:
contents: read
uses: hashintel/.github/.github/workflows/preflight-todo-comments.yml@a0df113e5602f3b721bf306bf6050ee2a0866956
Loading