Skip to content

Feature request: Add support for locking actions that use YAML anchors #252

Open

Description

@smdn

Current versions of actions-lock (as of v0.4.0) fail to detect and lock actions that use YAML anchors in the uses: field.

For example, the following configuration containing YAML anchors remains unhandled:

# `gh actions-lock` does not handle `uses:` that use YAML anchors
- name: Checkout
  uses: &checkout-uses actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  with: &checkout-with
    token: ...
    persist-credentials: ...

# Run the same action again using the same version and the same parameters
- name: Checkout again
  uses: *checkout-uses
  with: *checkout-with

Proposed Feature

Implementation of YAML anchor parsing enables actions-lock to correctly detect and process these actions as lock targets.

The expected behavior involves processing such configurations as follows:

  - name: Checkout
-   uses: &checkout-uses actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+   uses: &checkout-uses actions/checkout@v7.0.1
    with: &checkout-with
      token: ...
      persist-credentials: ...

  - name: Checkout again
    uses: *checkout-uses
    with: *checkout-with

Activity

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

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