Skip to content

[Feature] Better way of managing consistency check job's checkout action version #2157

@krzema12

Description

@krzema12

Problem

Right now, the version of actions/checkout action used in the consistency check job is hardcoded, and tied to a specific version of the library:

At the time of writing this feature request, there's already v6 of this action.

There are at least two problems here:

  1. If Renovate or another dependency updating bot is used, they update all occurrences of an action. However, since the consistency check job uses a hardcoded version of the action, not the one coming from the bindings server, there's a common problem with the consistency check job failing with:
    diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
    index 40da308..cf0745a 100644
    --- a/.github/workflows/build.yaml
    +++ b/.github/workflows/build.yaml
    @@ -15,7 +15,7 @@ jobs:
         steps:
         - id: 'step-0'
           name: 'Check out'
    -      uses: 'actions/checkout@v6'
    +      uses: 'actions/checkout@v4'
         - id: 'step-1'
           name: 'Execute script'
           continue-on-error: true
    One of the approaches here is to manually revert changes in the consistency check job, merge the PR that bumps the version in all other places, and once Renovate opens another PR to bump the remaining occurrences, close it (ignore Renovate updates for this version). The problem reoccurs for any next version of the action.
  2. Usually the major version bump of the checkout action happens when it uses a newer version of Node. It means that in some environments where the GitHub Actions workers are managed not by GitHub, using a newer action version is a must, not an option. In this case, the workflow using an obsolete action version is unusable and perhaps requires workarounds.

Proposed approach

Add to ConsistencyCheckJobConfig.Configuration a field that would specify which version is used.

Available options:

  • bundled with the library - the current behavior
  • specified manually - given by the user explicitly in ConsistencyCheckJobConfig.Configuration
  • inferred from the classpath - the library could look for classes named io.github.typesafegithub.workflows.actions.actions.Checkout, instantiate it and retrieve actionVersion
    • this option has a potential of being the new default one day

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions