From 3b4e18ba48056fd0e69f7abb90a68a1fe8aa81a2 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 23 Sep 2022 19:14:38 +0900 Subject: [PATCH] fix: fix delete --- action.yaml | 8 +++++--- testdata/milestone/normal/data.yaml | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 testdata/milestone/normal/data.yaml diff --git a/action.yaml b/action.yaml index 25c6235..a60d49f 100644 --- a/action.yaml +++ b/action.yaml @@ -106,21 +106,23 @@ runs: cat << EOS >> "$GITHUB_ENV" GHA_REF_NAME=${{fromJSON(inputs.data).event.ref}} EOS - if: env.GHA_EVENT_NAME == 'create' + if: contains(fromJSON('["create", "delete"]'), env.GHA_EVENT_NAME) - shell: bash run: | cat << EOS >> "$GITHUB_ENV" GHA_REF=refs/heads/${{fromJSON(inputs.data).event.ref}} EOS - if: "env.GHA_EVENT_NAME == 'create' && fromJSON(inputs.data).event.ref_type == 'branch'" + if: | + contains(fromJSON('["create", "delete"]'), env.GHA_EVENT_NAME) && fromJSON(inputs.data).event.ref_type == 'branch' - shell: bash run: | cat << EOS >> "$GITHUB_ENV" GHA_REF=refs/tags/${{fromJSON(inputs.data).event.ref}} EOS - if: "env.GHA_EVENT_NAME == 'create' && fromJSON(inputs.data).event.ref_type == 'tag'" + if: | + contains(fromJSON('["create", "delete"]'), env.GHA_EVENT_NAME) && fromJSON(inputs.data).event.ref_type == 'tag' - shell: bash run: | diff --git a/testdata/milestone/normal/data.yaml b/testdata/milestone/normal/data.yaml new file mode 100644 index 0000000..cf6691c --- /dev/null +++ b/testdata/milestone/normal/data.yaml @@ -0,0 +1 @@ +event_name: milestone