Skip to content

Detect unpinned reusable workflows - #22285

Open
theinfosecguy wants to merge 3 commits into
github:mainfrom
theinfosecguy:fix-actions-unpinned-reusable-workflows
Open

Detect unpinned reusable workflows#22285
theinfosecguy wants to merge 3 commits into
github:mainfrom
theinfosecguy:fix-actions-unpinned-reusable-workflows

Conversation

@theinfosecguy

Copy link
Copy Markdown
Contributor

Fixes #21659.

Extends actions/unpinned-tag to check reusable workflow calls.

Tests cover mutable refs, pinned SHAs, trusted owners, and local workflows.

@github-actions github-actions Bot added documentation Actions Analysis of GitHub Actions labels Aug 5, 2026
@theinfosecguy
theinfosecguy marked this pull request as ready for review August 5, 2026 17:38
@theinfosecguy
theinfosecguy requested a review from a team as a code owner August 5, 2026 17:38
michaelnebel
michaelnebel previously approved these changes Aug 12, 2026

@michaelnebel michaelnebel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you very much!
Added a couple of nit comments / questions.
Will start a DCA run as well.

Comment on lines +46 to +48
exists(UsesStep step, CompositeAction action |
uses = step and
step.getEnclosingCompositeAction() = action and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit suggestion

Suggested change
exists(UsesStep step, CompositeAction action |
uses = step and
step.getEnclosingCompositeAction() = action and
exists(CompositeAction action |
uses.(UsesStep).getEnclosingCompositeAction() = action and

@michaelnebel michaelnebel Aug 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suppose a Uses is implicitly a UsesStep if it has an enclosing composite action - so the cast is not needed either.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed and fixed.

then isPinnedContainer(version)
else isPinnedCommit(version)
) and
not exists(UsesStep step | uses = step and isImmutableAction(step, nwo)) and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is a similar MaD escape hatch needed for reusable workflows?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question. I don’t think the existing immutableActionsDataModel applies here. It models Immutable Actions used by steps, while reusable workflows aren’t resolved through that mechanism. They already get the trusted-owner exemption from this query.

@michaelnebel

Copy link
Copy Markdown
Contributor

DCA looks uneventful.

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

Labels

Actions Analysis of GitHub Actions documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

actions/unpinned-tag does not flag unpinned reusable workflow calls (job-level uses:)

2 participants