#!/usr/bin/env bash # Reproduces every command and output quoted in the reusable-workflow secrets post. Output goes to ./recorded/ # Needs: actionlint 1.7.12 in ../bin (see ../setup.sh), zizmor 1.33.1 on PATH (pip install zizmor==1.33.1). No network, no GitHub account. set -uo pipefail cd "$(dirname "$0")" export PATH="$PWD/../bin:$PATH" export NO_COLOR=1 rm -rf recorded work; mkdir -p recorded work R="$PWD/recorded" run() { # run : record the command line, the output and the exit code local out="$R/$1"; shift { echo "\$ $*"; "$@"; echo "[exit $?]"; } > "$out" 2>&1 } { actionlint -version | head -1; zizmor --version; git --version; uname -sm; } > "$R/00-versions.txt" # Each case becomes its own git repo: actionlint finds ./.github/workflows/*.yml relative to the repo root. for c in cases/*/; do n=$(basename "$c") cp -r "$c" "work/$n" git -C "work/$n" init -q . done i=1 for n in 1-missing 2-typo 3-undeclared 4-no-secrets-block 5-inherit 6-remote 7-caller-env 7b-env-in-with 8-fixed 9-self-repo 10-matrix; do num=$(printf '%02d' "$i") ( cd "work/$n" && run "$num-$n-actionlint.txt" actionlint -no-color ) ( cd "work/$n" && run "$num-$n-zizmor.txt" zizmor --offline --no-progress --quiet . ) i=$((i+1)) done # The fixed pair again, with a zizmor.yml that ignores only the self-repository audit for release.yml cp extras/zizmor.yml work/8-fixed/.github/zizmor.yml ( cd work/8-fixed && run 20-8-fixed-zizmor-with-config.txt zizmor --offline --no-progress --quiet . ) # The same thing with a severity floor instead of a config file ( cd work/4-no-secrets-block && run 21-4-zizmor-min-severity.txt zizmor --offline --no-progress --quiet --min-severity=medium . ) ( cd work/5-inherit && run 22-5-zizmor-min-severity.txt zizmor --offline --no-progress --quiet --min-severity=medium . )