Skip to content
Draft
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
18 changes: 17 additions & 1 deletion .github/workflows/dev-lead-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -799,11 +799,27 @@ jobs:
with:
token: ${{ secrets.GH_PAT_DON_PETRY || secrets.GH_PAT_WORKFLOWS || github.token }}

- name: Validate dev-lead scripts ref
id: agent_ref
env:
INPUT_AGENT_REF: ${{ inputs.agent_ref }}
run: |
ref="$INPUT_AGENT_REF"
if [ -z "$ref" ]; then
echo "::error::inputs.agent_ref must be provided as a pinned commit SHA."
exit 1
fi
if ! [[ "$ref" =~ ^[0-9a-fA-F]{40}$ ]]; then

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[High] Requiring inputs.agent_ref to be a 40-character commit SHA (! [[ "$ref" =~ ^[0-9a-fA-F]{40}$ ]]) and rejecting empty, branch, or tag refs breaks every dev-lead caller across the organization. Per standards/ci-standards.md, tests/test_sc2_self_review_channel.bats, and tests/dev-lead/integration/test_reusable_pin_compliance.py, caller stubs must pass a moving channel tag (dev-lead/v139-stable, dev-lead/v139-ring0, etc., or omit it to default to main) and are forbidden from SHA-pinning agent_ref. With this check in place, dispatch runs at line 256 using the channel tag, and this job then unconditionally fails at line 802. Validate against the allowed dev-lead channel/tag pattern (^main$|^dev-lead/(v[0-9]+(\.[0-9]+\.[0-9]+|-(stable|next|ring[0-9]+))|stable|next|ring[0-9]+)$, defaulting empty input to main) instead of requiring a 40-hex SHA.

echo "::error::inputs.agent_ref must be a full 40-character commit SHA; branch and tag refs are not allowed."
exit 1
fi
echo "ref=$ref" >> "$GITHUB_OUTPUT"

- name: Checkout dev-lead scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: combsmith/.github-private
ref: ${{ inputs.agent_ref }}
ref: ${{ steps.agent_ref.outputs.ref }}
path: .dev-lead
token: ${{ secrets.GH_PAT_DON_PETRY || secrets.GH_PAT_WORKFLOWS || github.token }}
sparse-checkout: |
Expand Down
Loading