From c42306d1c9968928d423e0fdf7706a581113bdab Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Wed, 21 Aug 2024 10:59:10 -0600 Subject: [PATCH] Account for no changes in previous step for scheduled_update.yaml --- .github/workflows/scheduled_update.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled_update.yaml b/.github/workflows/scheduled_update.yaml index 3f929f2..ccdceb5 100644 --- a/.github/workflows/scheduled_update.yaml +++ b/.github/workflows/scheduled_update.yaml @@ -60,7 +60,9 @@ jobs: - run: | gh repo sync tag=$(git describe --tags --abbrev=0) || release_needed="true" - for file in $(git diff ${tag}..${{ needs.update.outputs.sha }} --name-only); do + sha=${{ needs.update.outputs.sha }} + if [ -z "${sha}" ]; then sha="HEAD"; fi + for file in $(git diff ${tag}..${sha} --name-only); do if [ $file == "taginfo.json" ] || [ $file == "index.json" ] || [ $file == "package.json"] ; then release_needed="true" break @@ -68,7 +70,7 @@ jobs: done if [ $release_needed == "true" ]; then tag=$(jq -r '.version' package.json) - object=$(git rev-parse --verify ${{ needs.update.outputs.sha }}) + object=$(git rev-parse --verify ${sha}) gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \ /repos/${{ github.repository }}/git/tags \ --field "tag=${tag}" \