From 4f22d2ecc728c8146ab1d2a453fa1f480b9f3d24 Mon Sep 17 00:00:00 2001 From: mtgto Date: Sun, 27 Oct 2024 21:15:26 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=82=AF=E3=82=A8=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=81=AE=E3=82=B3=E3=83=AD=E3=83=B3?= =?UTF-8?q?=E3=81=8C=E6=8A=9C=E3=81=91=E3=81=A6=E3=81=84=E3=81=9F=E3=82=8A?= =?UTF-8?q?=E3=81=97=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/update.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 7d7ac78..443931b 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -4,6 +4,12 @@ on: release: types: [released] +# bashを使うようにしてpipefailを有効にする +# https://docs.github.com/ja/actions/writing-workflows/workflow-syntax-for-github-actions#defaultsrunshell +defaults: + run: + shell: bash + jobs: update: runs-on: ubuntu-latest @@ -12,14 +18,18 @@ jobs: id: sha256 run: | browser_download_url=$(echo '${{ toJSON(github.event.release.assets) }}' | jq -r '.[] | select(.name | endswith(".dmg")) | .browser_download_url') - SHA256=$(curl -L "${browser_download_url}" | sha256sum | cut -d ' ' -f 1) + echo $browser_download_url + SHA256=$(curl --fail -L "${browser_download_url}" | sha256sum | cut -d ' ' -f 1) + echo "sha256=${SHA256}" echo "sha256=${SHA256}" >> "GITHUB_OUTPUT" - name: dispatch env: GITHUB_TOKEN: ${{ secrets.HOMEBREW_MACSKK_TOKEN }} run: | curl \ - -H "Authorization token $GITHUB_TOKEN" \ + --fail \ + -H "Authorization: token $GITHUB_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ + -H "Content-Type: application/json" \ https://api.github.com/repos/mtgto/homebrew-macSKK/dispatches \ -d '{"event_type":"update","client_payload":{"version":"${{ github.event.release.tag_name }}","sha256":"${{ steps.sha256.outputs.sha256 }}"}}'