Skip to content

Add a check for outdated actions from the actions organization - #3460

Open
fulldecent wants to merge 2 commits into
actions:mainfrom
fulldecent:check-outdated-actions
Open

fulldecent wants to merge 2 commits into
actions:mainfrom
fulldecent:check-outdated-actions

Conversation

@fulldecent

Copy link
Copy Markdown
Contributor

Summary

This pull request is the validation half of #3091.

#3091 updates workflow files to newer releases of actions in the actions organization. This pull request adds the check those updates are for. script/check-outdated-actions exits 1 when a workflow depends on an older stable release than the one GitHub has published. .github/workflows/check-outdated-actions.yaml runs that script on every push and pull request. The rule is written up in script/check-outdated-actions/README.md.

The version the workflow wrote down is what gets compared:

  • actions/checkout@v5 is an error when a v6 release exists. It stays current through later v5 patch releases, because the v5 tag moves.
  • actions/cache@v5.2 is an error when a v5.3 release exists. A later major release is also an error. A later v5.2 patch is not, because the v5.2 tag moves.
  • actions/setup-python@v5.2.1 is an error when any newer stable release exists.

That is the tag scheme in Using immutable releases and tags to manage your action's releases. The highest release is the highest version number. The Releases API returns the release that was published most recently, and those are different orderings: actions/cache published v5.1.0 after v6.1.0.

A commit SHA uses the version comment beside it (# v4.2.2 is a patch pin, # actions/checkout@v4 is a major pin). A commit SHA with no version comment is current only when that commit is the highest stable release. I checked actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 in the policy-validator workflows: that commit is v4.1.1.

Running the script on this branch reports 275 references behind a published release, out of 289 references to 20 actions. References that are current include actions/deploy-pages@v5, actions/jekyll-build-pages@v1, actions/setup-haskell@v1, and actions/checkout@v7 in code-scanning/codeql.yml. The new workflow pins actions/checkout@v7 and actions/setup-node@v7, which are the current major tags.

The new check fails on this pull request. That failure is the report of the references above. I want this check reviewed and merged before the workflow files are updated. #3091 is that update, and it should land after this check is on main.

Please merge this with the failing check.


Pre-requisites

  • Prior to submitting a new workflow, please apply to join the GitHub Technology Partner Program: partner.github.com/apply.

Not applicable. This pull request does not add a starter workflow. It adds a repository CI script.


Please note that at this time we are only accepting new starter workflows for Code Scanning. Updates to existing starter workflows are fine.


Tasks

The checklist below describes a starter workflow. This pull request adds script/check-outdated-actions and the workflow that runs it, .github/workflows/check-outdated-actions.yaml.

For all workflows, the workflow:

  • Should be contained in a .yml file with the language or platform as its filename, in lower, kebab-cased format (for example, docker-image.yml). Special characters should be removed or replaced with words as appropriate (for example, "dotnet" instead of ".NET").

    Not applicable to a starter-workflow filename. The CI workflow file is .github/workflows/check-outdated-actions.yaml.

  • Should use sentence case for the names of workflows and steps (for example, "Run tests").

    The workflow name is "Check for outdated actions". The step name is "Check action versions".

  • Should be named only by the name of the language or platform (for example, "Go", not "Go CI" or "Go Build").

    Not applicable. This is repository CI, not a starter workflow.

  • Should include comments in the workflow for any parts that are not obvious or could use clarification.

    The workflow file points at script/check-outdated-actions/README.md, which is where the version rule is written down. The non-obvious part is that a major tag such as v5 is current until a later major exists, including while v5 patch releases continue.

  • Should specify least privileged permissions for GITHUB_TOKEN so that the workflow runs successfully.

    The job sets permissions: contents: read. The token is passed to the script so it can read public releases of actions/* repositories.

For CI workflows, the workflow:

  • Should be preserved under the ci directory.

    Not applicable. This file is the repository's own CI, under .github/workflows.

  • Should include a matching ci/properties/*.properties.json file (for example, ci/properties/docker-publish.properties.json).

    Not applicable. This is not a starter workflow.

  • Should run on push to branches: [ $default-branch ] and pull_request to branches: [ $default-branch ].

    The workflow runs on push and pull_request with no branch filter, matching .github/workflows/validate-data.yaml.

  • Packaging workflows should run on release with types: [ created ].

    Not applicable.

  • Publishing workflows should have a filename that is the name of the language or platform, in lower case, followed by "-publish" (for example, docker-publish.yml).

    Not applicable.

For Code Scanning workflows, the workflow:

  • Should be preserved under the code-scanning directory.

    Not applicable.

  • Should include a matching code-scanning/properties/*.properties.json file (for example, code-scanning/properties/codeql.properties.json), with properties set as follows:

    Not applicable.

    • name: Name of the Code Scanning integration.
    • creator: Name of the organization/user producing the Code Scanning integration.
    • description: Short description of the Code Scanning integration.
    • categories: Array of languages supported by the Code Scanning integration.
    • iconName: Name of the SVG logo representing the Code Scanning integration. This SVG logo must be present in the icons directory.
  • Should run on push to branches: [ $default-branch, $protected-branches ] and pull_request to branches: [ $default-branch ]. We also recommend a schedule trigger of cron: $cron-weekly (for example, codeql.yml).

    Not applicable.

Some general notes:

  • This workflow must only use actions that are produced by GitHub, in the actions organization, or

  • This workflow must only use actions that are produced by the language or ecosystem that the workflow supports. These actions must be published to the GitHub Marketplace. We require that these actions be referenced using the full 40 character hash of the action's commit instead of a tag. Additionally, workflows must include the following comment at the top of the workflow file:

    # This workflow uses actions that are not certified by GitHub.
    # They are provided by a third-party and are governed by
    # separate terms of service, privacy policy, and support
    # documentation.
    

    The new workflow uses actions/checkout@v7 and actions/setup-node@v7.

  • Automation and CI workflows should not send data to any 3rd party service except for the purposes of installing dependencies.

    The script reads public release metadata from api.github.com for repositories in the actions organization. npm ci installs the script's dependencies from the npm registry.

  • Automation and CI workflows cannot be dependent on a paid service or product.

script/check-outdated-actions exits 1 when a workflow uses an actions/*
reference that is behind a stable release.

A major reference such as v5 fails when v6 or later is published. A minor
reference such as v5.2 fails when v5.3 or a later major is published. A
patch reference fails when any newer stable release is published. The
highest release is the highest version number, because the Releases API
returns publish order. actions/cache published v5.1.0 after v6.1.0.

.github/workflows/check-outdated-actions.yaml runs the script on push and
pull request.

Refs: actions#3091
@fulldecent
fulldecent requested review from a team as code owners September 26, 2026 03:42
Copilot AI lite review requested due to automatic review settings September 26, 2026 03:42
@fulldecent

Copy link
Copy Markdown
Contributor Author

This is the validation half of #3091.

#3091 is the version update for actions in the actions organization. This pull request is the check, and it fails on the references that update is for. I counted 275 of 289 actions/* references behind a published release.

Please merge this check first, with the failing run. I will bring the version updates in after the check is on main.

@fulldecent

Copy link
Copy Markdown
Contributor Author

@elbrenn @cannist @jsoref @tsusdere @AnthonyZavala

I went through the commit history for the people who have already landed this kind of change.

@jsoref updated the workflows to actions/checkout@v4, actions/setup-node@v4, and actions/labeler@v5. @elbrenn merged the checkout v4 update in #2465. @cannist merged the checkout update in code-scanning/codeql.yml in #3392, and the github/codeql-action v4 update in #3082. @tsusdere shipped actions/deploy-pages@v5 in #3248. @AnthonyZavala merged the actions/cache@v4 update in #2369.

This pull request adds the check. A v5 reference fails when a v6 release exists. A v5.2 reference fails when a v5.3 release exists. I ran it on this branch: 275 of 289 references to actions in the actions organization are behind a published release. The version updates are in #3091.

Is this check a good idea to merge before those version updates? The failing run is the current state of the workflow files.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Address the workflow credential exposure and checker correctness issues before approval.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds a TypeScript CI check that detects outdated actions/* references using GitHub release metadata.

Changes:

  • Adds version, tag, and SHA validation logic.
  • Documents checker behavior and pinning rules.
  • Adds Node/TypeScript configuration and locked dependencies.
  • Adds a push and pull-request workflow to run the check.
File Description
script/​check-outdated-actions/​tsconfig.json Configures TypeScript compilation.
script/​check-outdated-actions/​README.md Documents usage and version/SHA rules.
script/​check-outdated-actions/​package.json Defines checker dependencies and scripts.
script/​check-outdated-actions/​package-lock.json Locks Node.js dependencies.
script/​check-outdated-actions/​index.ts Scans workflows and validates action references.
.github/​workflows/​check-outdated-actions.yaml Runs the checker on pushes and pull requests.
Files not reviewed (1)
  • script/check-outdated-actions/package-lock.json: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +25 to +31
- name: Check action versions
working-directory: ./script/check-outdated-actions
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
npm ci
npx ts-node ./index.ts
Comment thread script/check-outdated-actions/index.ts Outdated
Comment on lines +326 to +328
if (isOutdated(resolved, newest)) {
return finding(reference, behind(`${reference.uses} (${resolved.tag})`, newest));
}
@fulldecent fulldecent changed the title Add a check for outdated actions from the actions organization [WIP] Add a check for outdated actions from the actions organization Sep 26, 2026
@fulldecent
fulldecent marked this pull request as draft September 26, 2026 12:38
…t release

npm ci runs in its own step. GITHUB_TOKEN is set only on the checker step,
so a pull request cannot read the token from an install script.

A commit SHA with no version comment is current only when that commit is
the highest stable release. A release tag of v5 or v5.2 no longer hides a
newer release on the same line.
@fulldecent
fulldecent marked this pull request as ready for review September 26, 2026 23:37
@fulldecent fulldecent changed the title [WIP] Add a check for outdated actions from the actions organization Add a check for outdated actions from the actions organization Sep 26, 2026
@jsoref

jsoref commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Some github actions have not been able to update because of GHES.

Beyond that, this repository doesn't really accept contributions (I have 10 outstanding: https://github.com/actions/starter-workflows/pulls?q=is%3Apr+state%3Aopen+author%3Ajsoref), and it really isn't likely to accept workflow changes from external contributors.

@fulldecent

Copy link
Copy Markdown
Contributor Author

Some github actions have not been able to update because of GHES.

Thank you for your note. Are you saying that some of the actions (only Microsoft supported dependencies are in scope) do not run on GHES?

If so, is there a clean way to detect those?

@jsoref

jsoref commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

it isn't a strong claim. But https://github.com/actions/download-artifact#ghes-support seems to support the idea.

I don't work for MS/GitHub, so I can't really say much about the details, and I don't use GHES.

I think the general problem is that GHES's supported platforms include some really old things that don't include modern versions of node, but I'm not really sure. I had hoped that it'd have been resolved by now.

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.

6 participants