Skip to content

Commit

Permalink
Update build-pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaharagon committed Apr 10, 2024
1 parent c6100a0 commit d200d4d
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,21 @@ jobs:
metadata:
runs-on: ubuntu-latest
outputs:
submodules: ${{ steps.submodules.outputs.submodules }}
privileged: ${{ steps.submodules.outputs.privileged }}
matrix: ${{ steps.matrix-fork.outputs.matrix || steps.matrix-main.outputs.matrix }}
submodules: ${{ steps.submodules-fork.outputs.submodules || steps.submodules-main.outputs.submodules }}
privileged: ${{ steps.submodules-fork.outputs.privileged || steps.submodules-main.outputs.privileged }}
env:
ACTIONS_SSH_KEY: ${{ secrets.ACTIONS_SSH_KEY }}
steps:
- name: Set matrix for fork
if: env.ACTIONS_SSH_KEY == ''
id: matrix-fork
uses: druzsan/setup-matrix@v2
with:
matrix: |
repo: [brand, i18n]
- name: Set matrix for main repo
if: env.ACTIONS_SSH_KEY != ''
id: matrix-main
uses: druzsan/setup-matrix@v2
with:
matrix: |
repo: [brand, i18n, mkdocs-material-insiders]
- name: Set submodules for fork
if: env.ACTIONS_SSH_KEY == ''
id: submodules
id: submodules-fork
run: |
echo "submodules="[brand, i18n]"" >> "$GITHUB_OUTPUT"
echo "privileged=false" >> "$GITHUB_OUTPUT"
- name: Set submodules for main repo
if: env.ACTIONS_SSH_KEY != ''
id: submodules-main
run: |
echo "submodules="[brand, i18n, webserver]"" >> "$GITHUB_OUTPUT"
echo "privileged=true" >> "$GITHUB_OUTPUT"
Expand All @@ -64,11 +48,12 @@ jobs:
submodule:
needs: metadata
strategy:
matrix: ${{ fromJson(needs.metadata.outputs.matrix) }}
matrix:
repo: ${{ fromJson(needs.metadata.outputs.submodules) }}
uses: privacyguides/.github/.github/workflows/download-repo.yml@main
with:
repo: ${{ matrix.repo.name }}
privileged: ${{ needs.metadata.outputs.privileged }}
privileged: ${{ fromJSON(needs.metadata.outputs.privileged) }}
secrets:
ACTIONS_SSH_KEY: ${{ secrets.ACTIONS_SSH_KEY }}

Expand Down

0 comments on commit d200d4d

Please sign in to comment.