Files
deac 503c02b24c
publish.yaml / publish (push) Successful in 8s
fix: skip commit/push in update_version when tag is unchanged
git commit was failing the step (and job) with "nothing to commit" when
the target tag already matched releases/versions.yaml, e.g. on a re-run
for the same commit SHA.
2026-08-18 09:33:33 -04:00

47 lines
1.5 KiB
YAML

name: Update Infra Version
description: Updates the service tag in the stat-tackler-infra releases/versions.yaml
inputs:
token:
description: "Gitea token with read/write access to the infra repo"
required: true
service:
description: "Service name key in versions.yaml (e.g. stat-tackler-api)"
required: true
tag:
description: "The image tag to set for the service"
required: true
runs:
using: composite
steps:
- name: Clone infra repo
shell: sh
run: |
git clone https://gitea-actions:${{ inputs.token }}@gitea.pixelparasol.com/stat-tackler/stat-tackler-infra.git infra
- name: Install yq
shell: sh
run: |
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
chmod +x /usr/local/bin/yq
- name: Update tag in versions.yaml
shell: sh
run: |
cd infra
yq e ".services.${{ inputs.service }}.tag = \"${{ inputs.tag }}\"" -i releases/versions.yaml
- name: Commit and push
shell: sh
run: |
cd infra
git config user.email "gitea-actions@gitea.pixelparasol.com"
git config user.name "Gitea Actions"
git add releases/versions.yaml
if git diff --cached --quiet; then
echo "No version change for ${{ inputs.service }}, skipping commit"
exit 0
fi
git commit -m "chore: update ${{ inputs.service }} to ${{ inputs.tag }}"
git push