-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
38 lines (38 loc) · 1.18 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: 'Submitty Action Docker Matrix'
description: 'Builds the matrix for reusable docker build action'
inputs:
docker-username:
required: true
type: string
base-commit:
required: true
type: string
head-commit:
required: true
type: string
outputs:
matrix:
value: ${{ steps.generate-matrix.outputs.matrix }}
run_docker_jobs:
value: ${{ steps.set-run-docker.outputs.run_docker_jobs }}
runs:
using: "composite"
steps:
- name: Generate Matrix
id: generate-matrix
shell: bash
run: echo "matrix=$(python3 ${{ github.action_path }}/bin/generate_matrix.py ${{ inputs.docker-username }} ${{ inputs.base-commit }} ${{ inputs.head-commit }})" >> $GITHUB_OUTPUT
- name: List Matrix
shell: bash
run: |
echo ${{ steps.generate-matrix.outputs.matrix }}
- name: Set Run Condition
id: set-run-docker
shell: bash
run: |
num_to_build=$(echo '${{ steps.generate-matrix.outputs.matrix }}' | jq '.include | length')
if [[ "$num_to_build" -eq 0 ]]; then
echo "run_docker_jobs=false" >> $GITHUB_OUTPUT
else
echo "run_docker_jobs=true" >> $GITHUB_OUTPUT
fi