Sample workflows

Every secret handed over

secrets: inherit on a reusable workflow call, and toJSON(secrets) in a step.

secrets: inherit gives the called workflow every secret of the repository, and toJSON(secrets) puts all of them into one environment variable. A compromise of the called workflow or of the step then exposes all of them, not just the one it needed.

The reusable workflow here belongs to an example organization that doesn't exist, so the Fix tab can't pin it.

# Calls a shared deploy workflow and hands it every secret of the repository,# then prints a summary step with all secrets in its environment.name: Deploy on:  push:    branches: [main] permissions:  contents: read jobs:  deploy:    uses: example-org/shared-workflows/.github/workflows/deploy.yml@main    secrets: inherit   summary:    runs-on: ubuntu-latest    steps:      - run: ./scripts/summary.sh        env:          ALL_SECRETS: ${{ toJSON(secrets) }}