Skip to content

Commit 5dfaea9

Browse files
committed
Refine build workflow inputs and shell formatting
Address review feedback on PR #373 by renaming the manual image override input and reformatting long shell commands for readability.
1 parent e59a27e commit 5dfaea9

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/build.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ on:
99
inputs:
1010
force:
1111
description: Force rebuild and republish all image tags
12-
required: false
1312
default: true
1413
type: boolean
15-
image_name:
14+
image-name:
1615
description: Override image name for this manual run
17-
required: false
1816
default: ""
1917
type: string
2018

2119
env:
22-
IMAGE_NAME: ${{ inputs.image_name || vars.IMAGE_NAME || 'nikolaik/python-nodejs' }}
20+
IMAGE_NAME: ${{ inputs.image-name || vars.IMAGE_NAME || 'nikolaik/python-nodejs' }}
2321

2422
jobs:
2523
generate-matrix:
@@ -38,7 +36,12 @@ jobs:
3836
- name: Generate build matrix
3937
id: set-matrix
4038
run: |
41-
FORCE=$(if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.force }}" == "true" ]]; then echo "--force"; elif git log --pretty=format:"%s" HEAD^..HEAD | grep -q '\[force\]'; then echo "--force"; else echo ""; fi)
39+
FORCE=
40+
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.force }}" == "true" ]]; then
41+
FORCE="--force"
42+
elif git log --pretty=format:"%s" HEAD^..HEAD | grep -q '\[force\]'; then
43+
FORCE="--force"
44+
fi
4245
uv run dpn $FORCE build-matrix --event ${{ github.event_name }}
4346
4447
@@ -79,7 +82,10 @@ jobs:
7982
# Test
8083
- name: Run smoke tests
8184
run: |
82-
docker run --rm ${{ env.IMAGE_NAME }}:${{ matrix.key }} sh -c "node --version && npm --version && yarn --version && python --version && pip --version && pipenv --version && poetry --version && uv --version"
85+
docker run --rm ${{ env.IMAGE_NAME }}:${{ matrix.key }} sh -c \
86+
"node --version && npm --version && yarn --version && \
87+
python --version && pip --version && pipenv --version && \
88+
poetry --version && uv --version"
8389
8490
# Push image
8591
- name: Push image
@@ -97,7 +103,10 @@ jobs:
97103
run: |
98104
mkdir builds/
99105
digest="${{ steps.build-and-push.outputs.digest }}"
100-
echo '${{ toJSON(matrix) }}' | jq --arg digest "$digest" '. +={"digest": $digest}' >> "builds/${{ matrix.key }}.json"
106+
echo '${{ toJSON(matrix) }}' |
107+
jq --arg digest "$digest" \
108+
'. +={"digest": $digest}' \
109+
>> "builds/${{ matrix.key }}.json"
101110
102111
- name: Upload build context
103112
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0

0 commit comments

Comments
 (0)