Created
September 23, 2021 12:24
-
-
Save cdhunt/1f63b97f1fc3fde3b481d12008eb8ae3 to your computer and use it in GitHub Desktop.
Dymanic-ish GitHub Actions Workflow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs: | |
setup: | |
name: Setup Workflow Variables | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.matrix.outputs.matrix }} | |
steps: | |
- name: Generate Build matrix | |
id: matrix | |
shell: pwsh | |
run: | | |
$matrix = @{include = @()} | |
# Possible loop | |
$item = @{ | |
Repo = "blah" | |
PAT = "${{ secrets.PAT }}" | |
} | |
$matrix['include'] += $item | |
# End Loop | |
Write-Host ("::set-output name=matrix::{0}" -f ($matrix | ConvertTo-Json -Compress)) | |
checkout: | |
name: Build Stack Overflow image (${{ matrix.Repo }} | |
runs-on: ubuntu-latest | |
needs: [setup] | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
with: | |
repository: ${{ matrix.Repo }} | |
token: ${{ matrix.PAT }} | |
path: './somepath/${{ matrix.Repo }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment