diff --git a/.github/workflows/ci-go.yml b/.github/workflows/ci-go.yml index ef7ba78..ead35b7 100644 --- a/.github/workflows/ci-go.yml +++ b/.github/workflows/ci-go.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: @@ -22,6 +24,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 with: diff --git a/.github/workflows/ci-markdown.yml b/.github/workflows/ci-markdown.yml index 531a483..eeada75 100644 --- a/.github/workflows/ci-markdown.yml +++ b/.github/workflows/ci-markdown.yml @@ -16,14 +16,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - uses: h13/.github/actions/apply-org-config@9b63cbc981ae430485fde9132712ac5c70ad2c34 # main with: - config-file: .markdownlint-cli2.yaml + persist-credentials: false + + - name: Apply org markdownlint config if no local override + env: + CONFIG_FILE: .markdownlint-cli2.yaml + run: | + if [ ! -f "$CONFIG_FILE" ]; then + curl -fsSL "https://raw.githubusercontent.com/h13/.github/main/${CONFIG_FILE}" -o "$CONFIG_FILE" + echo "Applied org config: $CONFIG_FILE" + fi - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: # renovate: datasource=node-version depName=node node-version: "26" - - run: npx markdownlint-cli2 "${{ inputs.glob }}" + - env: + GLOB: ${{ inputs.glob }} + run: npx markdownlint-cli2 "$GLOB" diff --git a/.github/workflows/ci-node.yml b/.github/workflows/ci-node.yml index 8082011..84917a0 100644 --- a/.github/workflows/ci-node.yml +++ b/.github/workflows/ci-node.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false # Toolchain comes from the calling repository's .mise.toml — the single # source of truth for node/pnpm versions, kept fresh by Renovate. diff --git a/.github/workflows/ci-opentofu.yml b/.github/workflows/ci-opentofu.yml index a4ec302..364f18b 100644 --- a/.github/workflows/ci-opentofu.yml +++ b/.github/workflows/ci-opentofu.yml @@ -16,6 +16,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 with: @@ -29,6 +31,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: terraform-linters/setup-tflint@6ffdbaa3be476b3431f7275c26966ef32ff60337 # v6.3.2 diff --git a/.github/workflows/ci-php.yml b/.github/workflows/ci-php.yml index 3c1a81e..694670f 100644 --- a/.github/workflows/ci-php.yml +++ b/.github/workflows/ci-php.yml @@ -36,6 +36,8 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 with: @@ -55,7 +57,13 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Install dependencies - run: composer install --no-interaction --prefer-dist ${{ inputs.composer-args }} + env: + COMPOSER_ARGS: ${{ inputs.composer-args }} + run: | + # shellcheck disable=SC2086 # word splitting of the args is the contract + composer install --no-interaction --prefer-dist $COMPOSER_ARGS - name: Run tests - run: ${{ inputs.test-command }} + env: + TEST_COMMAND: ${{ inputs.test-command }} + run: eval "$TEST_COMMAND" diff --git a/.github/workflows/ci-terraform.yml b/.github/workflows/ci-terraform.yml index 42b7f98..422b0bb 100644 --- a/.github/workflows/ci-terraform.yml +++ b/.github/workflows/ci-terraform.yml @@ -23,6 +23,8 @@ jobs: working-directory: ${{ inputs.working-directory }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1 with: @@ -39,6 +41,8 @@ jobs: working-directory: ${{ inputs.working-directory }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: terraform-linters/setup-tflint@6ffdbaa3be476b3431f7275c26966ef32ff60337 # v6.3.2 diff --git a/.github/workflows/ci-zizmor.yml b/.github/workflows/ci-zizmor.yml new file mode 100644 index 0000000..b1a7fcc --- /dev/null +++ b/.github/workflows/ci-zizmor.yml @@ -0,0 +1,30 @@ +name: CI (zizmor) + +on: + workflow_call: + inputs: + min-severity: + description: Minimum severity to report (informational/low/medium/high) + type: string + # medium by default so adopting repos are not blocked by the + # widespread low-severity findings (e.g. artipacked); tighten per repo. + default: medium + +permissions: + contents: read + +jobs: + zizmor: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - uses: zizmorcore/zizmor-action@1b4550e929643b8b26a62303c6bd64814271a4f1 # v0.9.2 + with: + # renovate: datasource=pypi depName=zizmor + version: "1.33.1" + advanced-security: "false" + annotations: "true" + min-severity: ${{ inputs.min-severity }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 312dd0b..5c260c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12 @@ -36,3 +38,9 @@ jobs: uses: ./.github/workflows/ci-markdown.yml with: glob: "{README,CONTRIBUTING,SECURITY,profile/**,sync/**}.md" + + zizmor: + uses: ./.github/workflows/ci-zizmor.yml + with: + # The source of the shared workflows holds itself to the strict bar. + min-severity: low diff --git a/.github/workflows/publish-node.yml b/.github/workflows/publish-node.yml index 412879c..88303c4 100644 --- a/.github/workflows/publish-node.yml +++ b/.github/workflows/publish-node.yml @@ -12,6 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index 01d2cc9..e0d18d0 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -15,6 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Generate sync config from Node.js repos env: diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 0000000..1215541 --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,5 @@ +rules: + self-repository: + # actionlint (<=1.7.12) rejects the suggested `$/` syntax; drop once it learns it. + ignore: + - ci.yml diff --git a/README.md b/README.md index e7e4f05..e7361a6 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,9 @@ jobs: ## Composite Actions -| Action | Description | -| -------------------------- | ----------------------------------------------- | -| `actions/apply-org-config` | Download org config if no local override exists | +| Action | Description | +| ------------------------- | ---------------------------------------------------------- | +| `actions/setup-toolchain` | mise runtimes + pnpm store cache + lockfile-pinned install | ## Automation @@ -76,10 +76,10 @@ h13/dotfiles ← Dev environment + repo-init └─ configures → GitHub settings (branch protection, labels, alerts) h13/.github ← Reusable Workflows + shared config ★ - ├─ ci-{node,go,php,terraform,markdown}.yml (reusable, SHA-pinned) + ├─ ci-{node,go,php,opentofu,terraform,markdown,zizmor}.yml (reusable, SHA-pinned) ├─ compliance-audit.yml (monthly) ├─ repo-sync.yml (dynamic sync to all repos) - └─ apply-org-config action + └─ setup-toolchain action h13/renovate-config ← Shared Renovate preset ├─ default.json (config:best-practices + all stack rules, single preset) diff --git a/actions/apply-org-config/action.yml b/actions/apply-org-config/action.yml deleted file mode 100644 index 5c43adb..0000000 --- a/actions/apply-org-config/action.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Apply org config -description: Download org-wide config file from h13/.github if no local override exists - -inputs: - config-file: - description: Config filename to check and apply (e.g. .markdownlint-cli2.yaml) - required: true - -runs: - using: composite - steps: - - name: Apply org config if no local override - shell: bash - run: | - if [ -f "${{ inputs.config-file }}" ]; then - echo "Local config found: ${{ inputs.config-file }} (skipping org default)" - else - curl -fsSL "https://raw.githubusercontent.com/h13/.github/main/${{ inputs.config-file }}" \ - -o "${{ inputs.config-file }}" - echo "Applied org config: ${{ inputs.config-file }}" - fi