From 36b970734a442f1211868527e850a424e6597d2c Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 20 Jan 2023 12:21:37 +0900 Subject: [PATCH 1/2] fix: support push event --- action.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index df01b86..1fafd57 100644 --- a/action.yaml +++ b/action.yaml @@ -40,7 +40,11 @@ runs: if ! git diff --cached --exit-code ${CHECKSUM_FILE}; then echo "::error file=${CHECKSUM_FILE}::${CHECKSUM_FILE} isn't latest. A commit is pushed automatically to update ${CHECKSUM_FILE}." # https://github.com/int128/ghcp - ghcp commit -r "$GITHUB_REPOSITORY" -b "$GITHUB_HEAD_REF" \ + branch=${GITHUB_HEAD_REF:-} + if [ -z "$branch" ]; then + branch=$GITHUB_REF + fi + ghcp commit -r "$GITHUB_REPOSITORY" -b "$branch" \ -m "chore(aqua): update $CHECKSUM_FILE" \ aqua-checksums.json exit 1 From d920233e7ee108176f339a9cfd775f1fdab559bd Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 20 Jan 2023 14:53:49 +0900 Subject: [PATCH 2/2] fix: change GITHUB_REF to GITHUB_REF_NAME --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 1fafd57..36eac9c 100644 --- a/action.yaml +++ b/action.yaml @@ -42,7 +42,7 @@ runs: # https://github.com/int128/ghcp branch=${GITHUB_HEAD_REF:-} if [ -z "$branch" ]; then - branch=$GITHUB_REF + branch=$GITHUB_REF_NAME fi ghcp commit -r "$GITHUB_REPOSITORY" -b "$branch" \ -m "chore(aqua): update $CHECKSUM_FILE" \