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

Đang mở
#252 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, go, yaml
Lĩnh vực
cli

Hướng nghiên cứu

The payload names no source files, so start by finding where the tool reads uses: values from workflow YAML and how it parses those documents. Reproduce with the anchored Checkout example in the issue and see whether the anchor-aliased uses: line is skipped. Done means the aliased step is detected and locked, and the expected output in the issue is confirmed with the maintainers first, since it replaces the commit SHA with a tag.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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/[email protected]
    with: &checkout-with
      token: ...
      persist-credentials: ...

  - name: Checkout again
    uses: *checkout-uses
    with: *checkout-with
Ngôn ngữ chính
Go
Star
253
Fork
15
Merge trung bình
19 giờ 30 phút
Pull request đã merge (30 ngày)
60

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/gh-actions-lock

Tất cả issue của github/gh-actions-lock

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.