Support for basic statically resolvable expressions in `container` field

Aperta
#236 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
github-actions, go
Ambito
cli, security

Direzione di ricerca

Start by tracing how gh actions-lock --verify reads the workflow container field and reports expressions it cannot resolve; the payload names no source files or tests. Check how matrix values are represented and whether statically defined include entries can supply container values. Done means verification can resolve these static matrix expressions while still warning about values chosen at runtime.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:cli feature-request

Hi! When running gh actions-lock --verify , I get the warning below.

! container image `${{ matrix.container }}` is chosen at runtime, so the lockfile can't check it
  ↳ used by .github/workflows/build-ifcopenshell-linux.yml: job build container
  ↳ use a literal image pinned by digest where possible, or pin each value of the matrix or input by digest

Though this is mentioned in limitations in readme (This includes images chosen by a ${{ }} expression), is there any chance container can support resolving expressions that refer to static matrices?

In my case matrix is fully defined statically, so it's possible to infer the container value.

Otherwise to resolve this warning I need to drop matrices completely for such cases and instead split action in 2 jobs - either by moving the entire job code to a composite action or by using YAML anchors (e.g. steps: &build-steps in one job and steps: *build-steps in another).
Both result in less idiomatically written actions.

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        include:
          - arch_suffix: linux64
            runner: ubuntu-22.04
            container:
              image: rockylinux:9@sha256:…
          - arch_suffix: linuxarm64
            runner: ubuntu-22.04-arm
            container:
              image: rockylinux/rockylinux:10@sha256:…
              env:
                PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    name: build (${{ matrix.arch_suffix }})
    runs-on: ${{ matrix.runner }}
    container: ${{ matrix.container }}
Lingua principale
Go
Stelle
253
Fork
15
Merge medio
19h 30m
PR unite (30g)
60

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/gh-actions-lock

Tutte le issue di github/gh-actions-lock

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.