From 783da6ab3ba5dab1d70c5e80383f51d707e53535 Mon Sep 17 00:00:00 2001 From: Maximilian Herold Date: Wed, 3 Apr 2024 11:06:45 +0200 Subject: [PATCH] Try to fix gempush GH workflow Got error: "fatal: ambiguous argument 'HEAD..HEAD^': unknown revision or path not in the working tree." Also, make gempush-if-failed script fail on error. --- .github/workflows/gempush.yml | 2 ++ bin/gempush-if-changed | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/gempush.yml b/.github/workflows/gempush.yml index 031f174..2e35a5b 100644 --- a/.github/workflows/gempush.yml +++ b/.github/workflows/gempush.yml @@ -12,6 +12,8 @@ jobs: steps: - uses: actions/checkout@master + with: + fetch-depth: 2 - name: Set up Ruby 2.7 uses: ruby/setup-ruby@v1 with: diff --git a/bin/gempush-if-changed b/bin/gempush-if-changed index 35f0d38..aa8154c 100755 --- a/bin/gempush-if-changed +++ b/bin/gempush-if-changed @@ -1,6 +1,7 @@ #!/bin/bash set -x +set -euo pipefail if git diff --name-only HEAD..HEAD^ | egrep -q '^VERSION$'; then # The VERSION file changed in the last commit, build the gem and push gem build *.gemspec