Skip to content

[auto commit] update context (workflow=auto dump context, event=pull_… #665

[auto commit] update context (workflow=auto dump context, event=pull_…

[auto commit] update context (workflow=auto dump context, event=pull_… #665

name: matrix secret
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
FRUIT: APPLES
jobs:
dereference:
strategy:
matrix:
org: [apples, bananas, carrots] #Array of org mnemonics to use below
include:
# includes a new variable for each org (this is effectively a switch statement)
- org: apples
secret: APPLES
- org: bananas
secret: BANANAS
- org: carrots
secret: CARROTS
permissions:
contents: read
runs-on: ubuntu-24.04
timeout-minutes: 3
steps:
- run: echo "org:${{ matrix.org }} secret:${SECRET}"
env:
SECRET: ${{ secrets[matrix.secret] }} # zizmor: ignore[overprovisioned-secrets]
- run: echo "env:${FRUIT} secret:${SECRET}"
env:
SECRET: ${{ secrets.APPLES }} # explicit secret reference avoids overprovisioned secrets