Skip to content

Commit e8cbce5

Browse files
committed
ci: fix std-action bug with empty build matrix
1 parent dfe5acf commit e8cbce5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/std.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,29 @@ jobs:
6767
name: ${{ matrix.target.jobName }}
6868
runs-on: ubuntu-latest
6969
needs: discover
70-
if: fromJSON(needs.discover.outputs.hits).oci-images.publish != '{}'
7170
strategy:
7271
matrix:
73-
target: ${{ fromJSON(needs.discover.outputs.hits).oci-images.publish }}
72+
target: ${{ contains(fromJSON(needs.discover.outputs.hits), 'oci-images') && fromJSON(needs.discover.outputs.hits).oci-images.publish || fromJSON('["dummy-target"]') }}
7473
steps:
7574
- name: Configure AWS Credentials
75+
if: matrix.target != 'dummy-target'
7676
uses: aws-actions/[email protected]
7777
with:
7878
role-to-assume: ${{ env.AWS_ROLE_ARN }}
7979
aws-region: ${{ env.AWS_REGION }}
8080
- name: Login to Amazon ECR
81+
if: matrix.target != 'dummy-target'
8182
id: login-ecr
8283
uses: aws-actions/amazon-ecr-login@v1
8384
- uses: nixbuild/nix-quick-install-action@v25
85+
if: matrix.target != 'dummy-target'
8486
- uses: nixbuild/nixbuild-action@v17
87+
if: matrix.target != 'dummy-target'
8588
with:
8689
nixbuild_ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
8790
generate_summary_for: job
8891
- uses: divnix/std-action/setup-discovery-ssh@main
92+
if: matrix.target != 'dummy-target'
8993
with:
9094
ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
9195
user_name: ${{ env.DISCOVERY_USER_NAME }}
@@ -95,6 +99,7 @@ jobs:
9599
run: |
96100
echo commit: ${{ github.sha }}
97101
- uses: divnix/std-action/run@main
102+
if: matrix.target != 'dummy-target'
98103
with: {ffBuildInstructions: true, remoteStore: "ssh-ng://eu.nixbuild.net"}
99104

100105

0 commit comments

Comments
 (0)