diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7181ff4..6076b69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,8 +5,7 @@ on: - push - pull_request_target -permissions: read-all - # down scope as necessary via https://docs.github.com/en/actions/reference/authentication-in-a-workflow#modifying-the-permissions-for-the-github_token +permissions: write-all env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} diff --git a/Taskfile.yml b/Taskfile.yml index 8be837a..6e28ca9 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -39,7 +39,7 @@ tasks: mkdir -p $HOME/bin curl -L https://github.com/Backblaze/B2_Command_Line_Tool/releases/latest/download/b2-linux -o {{.B2_BIN_PATH}} chmod +x {{.B2_BIN_PATH}} - export PATH=$PATH:$HOME/bin + {{.B2_BIN_PATH}} version {{.B2_BIN_PATH}} authorize-account else echo "b2 is already installed." @@ -121,7 +121,7 @@ tasks: ci: desc: Continuous Integration build - deps: - - install-b2 - - get-gallery-images - - build + cmds: + - task: install-b2 + - task: get-gallery-images + - task: build diff --git a/get_gallery_images.sh b/get_gallery_images.sh index 16e7ccb..5bcd395 100755 --- a/get_gallery_images.sh +++ b/get_gallery_images.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -e export PATH=$PATH:$HOME/bin + ## Configuration ############################################################### SEARCH_PATH="content/gallery/**" B2_APPLICATION_KEY_ID=$2 @@ -9,8 +11,8 @@ B2_APPLICATION_KEY=$3 # Check if b2 command is available if ! command -v b2 &> /dev/null then - echo "b2 could not be found" - exit + echo "ERROR: b2 command not be found" + exit 255 fi ## Flight ######################################################################