Skip to content

fix(ci): validate and sync composite action pins against the actions registry#3367

Open
qubeena07 wants to merge 1 commit into
microsoft:mainfrom
qubeena07:fix/3366-composite-action-registry-check
Open

fix(ci): validate and sync composite action pins against the actions registry#3367
qubeena07 wants to merge 1 commit into
microsoft:mainfrom
qubeena07:fix/3366-composite-action-registry-check

Conversation

@qubeena07

Copy link
Copy Markdown
Contributor

Summary

Closes #3366.

The two composite actions under .github/actions, contributor-check and ai-agent-runner, pin actions/setup-python and actions/setup-node directly and were never checked against .github/ci/actions.toml. They had already drifted to older versions than the registry without anything catching it.

This teaches scripts/ci/generate_workflows.py to also read those composite action files. Check now fails if a pinned action there does not match the registry entry for that same action name, and write rewrites just the uses line to match the registry, leaving the rest of the file untouched. The ci generation check workflow now also runs on changes under .github/actions so this stays guarded going forward.

Ran generate_workflows.py --write once to bring both files back in sync with the current registry, and added tests covering the new check and sync behavior.

Test plan

  • python3 scripts/ci/generate_workflows.py --check passes, generated workflows are up to date
  • python3 -m pytest tests/ci passes, 76 tests including the four new ones
  • all touched yaml files parse cleanly with yaml.safe_load
  • confirmed the diff on both composite action files only touches the uses line, nothing else

…registry

The two composite actions under .github/actions, contributor-check and ai-agent-runner, pin actions/setup-python and actions/setup-node directly and were never checked against .github/ci/actions.toml, so they had already drifted to older versions than the registry without anything catching it.

This teaches scripts/ci/generate_workflows.py to also read those composite action files. Check now fails if a pinned action there does not match the registry entry for that same action name, and write rewrites just the uses line to match, leaving the rest of the file untouched. The ci generation check workflow now also runs on changes under .github/actions so this stays guarded going forward.

Ran generate_workflows.py --write once to bring both files back in sync with the current registry, and added tests covering the new check and sync behavior.

Fixes microsoft#3366
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown
🤖 AI Agent: breaking-change-detector — API Compatibility

AI-generated review output. Treat it as untrusted analysis and verify before acting.

API Compatibility

No breaking changes detected.

@github-actions

Copy link
Copy Markdown
🤖 AI Agent: docs-sync-checker — Docs Sync

AI-generated review output. Treat it as untrusted analysis and verify before acting.

Docs Sync

  • check_composite_action_pins(actions: dict[str, str]) in scripts/ci/generate_workflows.py -- missing docstring
  • sync_composite_action_pins(actions: dict[str, str]) in scripts/ci/generate_workflows.py -- missing docstring
  • README.md -- no updates detected to reflect the new functionality of generate_workflows.py regarding composite action pin validation and synchronization.
  • CHANGELOG -- missing entry for the new behavior of generate_workflows.py to validate and sync composite action pins against the actions registry.

@github-actions

Copy link
Copy Markdown
🤖 AI Agent: test-generator — `scripts/ci/generate_workflows.py`

AI-generated review output. Treat it as untrusted analysis and verify before acting.

scripts/ci/generate_workflows.py

  • test_composite_action_error_handling -- validate behavior when COMPOSITE_ACTIONS_DIR is missing or inaccessible.
  • test_invalid_action_format -- ensure the script handles malformed action.yml files gracefully.
  • test_registry_mismatch_handling -- verify error handling when the registry file is missing or corrupted.
  • test_empty_composite_action_dir -- confirm no errors occur when COMPOSITE_ACTIONS_DIR is empty.

@github-actions github-actions Bot added the size/M Medium PR (< 200 lines) label Jul 17, 2026
@github-actions

Copy link
Copy Markdown
🤖 AI Agent: code-reviewer — View details

AI-generated review output. Treat it as untrusted analysis and verify before acting.

TL;DR: 0 blockers, 0 warnings. The changes improve CI robustness by ensuring composite action pins are validated and synchronized with the actions registry.

# Sev Issue Where

No action required. Clean change.

@github-actions

Copy link
Copy Markdown
🤖 AI Agent: security-scanner — View details

AI-generated review output. Treat it as untrusted analysis and verify before acting.

No security issues found.

@github-actions

Copy link
Copy Markdown

PR Review Summary

Check Status Details
🔍 Code Review ⚠️ Missing No current-run comment
🛡️ Security Scan ⚠️ Missing No current-run comment
🔄 Breaking Changes ⚠️ Missing No current-run comment
📝 Docs Sync ⚠️ Missing No current-run comment
🧪 Test Coverage ⚠️ Missing No current-run comment

Verdict: ⚠️ AI review incomplete; ready for human review

AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims.

@MohammadHaroonAbuomar MohammadHaroonAbuomar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Sequencing: merge #3365 first, then rebase this and re-run scripts/ci/generate_workflows.py --write. Verified locally: clean git merge but real semantic conflict — this PR synced composite pins against main's current registry; #3365 moves setup-python to v6.3.0, so whichever merges second leaves main's ci-generation-check red (contributor-check/action.yml pinned to v6.2.0, registry expects v6.3.0). One --write re-run fixes it.
  • (process) MAINTAINER: 15 action_required; approve runs. Check itself verified fail-closed empirically (drift -> exit 1).

Minor:

  • setup-node v4.4.0->v6.4.0 in ai-agent-runner is a two-major registry-driven jump; node-version:22 is explicit so low risk, but worth a smoke run of that composite.

@imran-siddique

Copy link
Copy Markdown
Collaborator

Hi @qubeena07, this PR has requested changes that are still open, with no update for a while. Could you address the review feedback when you have a chance? If there is no activity within one week we will close this to keep the review queue manageable, and you are welcome to reopen once you are ready. Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scripts/ci/cd size/M Medium PR (< 200 lines) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

composite actions in .github/actions are not covered by the actions.toml pin registry and have already drifted

3 participants