Skip to content

feat: recurse into composite actions and show source workflows in summary#61

Merged
joshjohanning merged 14 commits into
joshjohanning:mainfrom
Wuodan:upstream-PR/recurse-into-remote-actions
Apr 10, 2026
Merged

feat: recurse into composite actions and show source workflows in summary#61
joshjohanning merged 14 commits into
joshjohanning:mainfrom
Wuodan:upstream-PR/recurse-into-remote-actions

Conversation

@Wuodan

@Wuodan Wuodan commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Contains previous PR commits up to #60.

This change recurses into remote composite actions and remote reusable workflows.

That closes the remaining dependency-coverage gap apart from unsupported docker:// references, because indirect third-party action references pulled in from external workflows and composite actions are now included in the scan.

Test workflows:

Validation run with this PR branch:

The test run also validates the action outputs, unlike the earlier PR test runs.


Also included (from closed PRs)

@joshjohanning joshjohanning changed the title Recurse into remote composite actions and reusable workflows feat: recurse into composite actions and show source workflows in summary Apr 10, 2026
# Conflicts:
#	__tests__/index.test.js
#	badges/coverage.svg
#	package-lock.json
#	package.json
#	src/index.js

Copilot AI 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.

Pull request overview

Expands the action’s dependency scanning to cover indirect references by recursing into both composite actions and reusable workflows (including remote ones), and enhances reporting by attributing findings back to the caller workflow locations.

Changes:

  • Recurse into local composite actions during extraction, and into remote composite actions / remote reusable workflows during expansion.
  • Track and surface caller-side β€œsource workflow” locations in summaries and logs (including workflow links).
  • Add supporting helpers/tests and bump package version.
Show a summary per file
File Description
src/index.js Adds recursion/expansion logic for composite actions & reusable workflows and enhances summary/reporting with caller source locations.
tests/index.test.js Adds tests for local recursion, remote expansion, source-location formatting, and new helpers.
package.json Bumps version to reflect behavior change.
package-lock.json Updates lockfile version metadata to match package.json bump.
badges/coverage.svg Updates coverage badge after new tests/lines.

Copilot's findings

Comments suppressed due to low confidence (1)

src/index.js:1011

  • In byWorkflow grouping, sourceLocations is set from the per-workflow deduplication, but then ...cachedResult is spread afterwards. For unsupported actions, cachedResult currently includes its own sourceLocations (from the global unsupported list), which overwrites the per-workflow aggregated locationsβ€”so the summary can lose additional β€œfound in” entries. Move the sourceLocations assignment to after the spread (or avoid storing sourceLocations in the cache) so per-workflow aggregation wins.
        workflowFile: action.workflowFile,
        sourceLocations: action.sourceLocations || [],
        supported: action.supported !== false,
        isFirstParty: action.isFirstParty || false,
        ...cachedResult
      };
  • Files reviewed: 3/5 changed files
  • Comments generated: 1

Comment thread src/index.js Outdated

Copilot AI 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.

Pull request overview

This PR expands the action reference extraction logic to recursively discover nested uses: references inside composite actions and reusable workflows (including remote ones), and enhances reporting to show caller workflow source locations in the summary and logsβ€”closing remaining dependency coverage gaps for indirect references.

Changes:

  • Add recursion into local composite actions plus remote composite actions and remote reusable workflows to expand nested uses: references.
  • Track and surface caller-side source locations (β€œfound in” workflows) in summary output/logging and improve reference formatting to include subpaths.
  • Bump package version to 2.4.0 and update docs/tests accordingly.
Show a summary per file
File Description
src/index.js Adds local/remote recursion, source-location tracking, cache/dedup changes, and improved formatting for path-based references.
tests/index.test.js Adds/updates tests for recursion, remote content fetching, source formatting, and new helper functions.
README.md Documents expanded scan coverage and token requirements for remote recursion; updates β€œHow it Works”.
action.yml Updates github-token input description to reflect remote recursion requirements.
package.json Version bump to 2.4.0.
package-lock.json Lockfile version sync with package.json bump.
badges/coverage.svg Updates coverage badge to reflect current test coverage.

Copilot's findings

  • Files reviewed: 5/7 changed files
  • Comments generated: 5

Comment thread src/index.js Outdated
Comment thread src/index.js
Comment thread src/index.js Outdated
Comment thread __tests__/index.test.js
Comment thread README.md Outdated
- Fix cache mis-attribution by always deriving caller metadata from parentAction
- Rewrite local refs in remote reusable workflows to remote refs
- Skip docker actions silently instead of reporting as unsupported
- Save/restore env vars in tests to prevent leakage
- Fix README to match actual behavior for private repo recursion

Copilot AI 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.

Pull request overview

This PR expands the action’s dependency scanning to recursively traverse remote composite actions and remote reusable workflows, and enhances reporting by surfacing caller workflow context in the summary/output metadata.

Changes:

  • Recurse into local composite actions (nested ./ uses) and remote composite/reusable workflow references via repos.getContent.
  • Add caller/source workflow metadata aggregation for clearer β€œfound in” reporting and traversal hints.
  • Bump package version to 2.4.0 and extend Jest coverage for the new recursion/reporting behavior.
Show a summary per file
File Description
src/index.js Adds local/remote recursion, remote file fetching, action-path parsing, cache keying, and summary/source formatting updates.
__tests__/index.test.js Adds/updates tests for action-path parsing, local composite recursion, remote expansion, and summary/source formatting.
README.md Documents expanded scan coverage and token requirements for remote recursion.
action.yml Updates github-token input description to reflect recursion needs.
package.json Version bump to 2.4.0.
package-lock.json Lockfile version bump to match 2.4.0.
badges/coverage.svg Updates coverage badge value after test changes.

Copilot's findings

Comments suppressed due to low confidence (1)

src/index.js:905

  • Excluded first-party actions (when includeFirstParty is false) are added to the first-party-actions output without actionPath. Since parseActionReference() now supports path-based references (e.g. github/codeql-action/init@v3), the output will lose the path for these excluded actions. Consider including actionPath here (and in the cached entry if needed) to keep output fields consistent with the checked-first-party path handling.
  // Process excluded first-party actions (no API check needed) - deduplicate by uses string
  const uniqueExcludedFirstParty = Array.from(new Map(excludedFirstPartyActions.map(a => [a.uses, a])).values());
  for (const action of uniqueExcludedFirstParty) {
    const actionInfo = {
      uses: action.uses,
      owner: action.owner,
      repo: action.repo,
      ref: action.ref,
      isFirstParty: true,
      immutable: true,
      releaseFound: false,
      message: 'Excluded (first-party)',
      allowed: true,
      excluded: true
    };
  • Files reviewed: 5/7 changed files
  • Comments generated: 2

Comment thread src/index.js
Comment thread __tests__/index.test.js Outdated
@joshjohanning

Copy link
Copy Markdown
Owner

This is great @Wuodan!!! πŸŽ‰ Thank you πŸ™‡

@joshjohanning joshjohanning merged commit 12c5e55 into joshjohanning:main Apr 10, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

πŸ“¦ Draft Release Created

A draft release v2.4.0 has been created for this PR.

πŸ”— View Draft Release

Next Steps

  • Review the release notes
  • Publish the release to make it permanent

This is an automated reminder from the publish-github-action workflow.

@Wuodan Wuodan deleted the upstream-PR/recurse-into-remote-actions branch April 19, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants