diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5e47ca3..c9a6d9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,9 +25,16 @@ jobs: # Fetch the latest changes git fetch origin main - # Check for changes in .tex, .sty, .cls, or Docker-related files - if git diff --name-only HEAD^ HEAD | grep -E "^(.docker/|.*\.(tex|sty|cls)$)" > /dev/null; then - CHANGED=1 + # Check if there are more than one commit to compare against + if [ "$(git rev-list --count HEAD)" -gt 1 ]; then + # Ensure that there is more than 1 commit in the history + if git diff --name-only HEAD^ HEAD | grep -E "^(.docker/|.*\.(tex|sty|cls)$)" > /dev/null; then + CHANGED=1 + fi + else + # If there's no previous commit (only 1 commit), assume no changes to the relevant files + echo "Only one commit or no previous commit, skipping change check." + CHANGED=0 fi echo "changed=${CHANGED}" >> $GITHUB_OUTPUT