From 170f8688f0065b59f46fb90a968b875b85e45e1e Mon Sep 17 00:00:00 2001 From: zachmann Date: Tue, 20 Aug 2024 16:50:48 +0200 Subject: [PATCH] fix warnings/errors --- .github/workflows/publish.yml | 4 ++-- README.md | 10 ++++++++-- updateToNewestRelease.sh | 6 ++++-- updateToRelease.sh | 17 +++++++++++------ 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a5c98ba..301a22e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,7 +21,7 @@ jobs: HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }} HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.actor }} PULL_REQUEST: ${{ github.event.pull_request.number }} - run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST + run: brew pr-pull --debug --tap="${GITHUB_REPOSITORY}" "${PULL_REQUEST}" - name: Push commits uses: Homebrew/actions/git-try-push@master @@ -33,4 +33,4 @@ jobs: if: github.event.pull_request.head.repo.fork == false env: BRANCH: ${{ github.event.pull_request.head.ref }} - run: git push --delete origin $BRANCH + run: git push --delete origin "${BRANCH}" diff --git a/README.md b/README.md index ad8a6a2..2e5fabe 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,19 @@ ## How do I install these formulae? -`brew install indigo-dc/oidc-agent/` +``` +brew install indigo-dc/oidc-agent/ +``` +i.e. +``` +brew install indigo-dc/oidc-agent/oidc-agent +``` Or `brew tap indigo-dc/oidc-agent` and then `brew install `, i.e. + ``` brew tap indigo-dc/oidc-agent brew install oidc-agent -`````` ``` ## Documentation diff --git a/updateToNewestRelease.sh b/updateToNewestRelease.sh index 710214f..8a85855 100755 --- a/updateToNewestRelease.sh +++ b/updateToNewestRelease.sh @@ -1,9 +1,11 @@ #!/bin/bash +set -e + token=$(git config --global github.token) json=$(http https://api.github.com/repos/indigo-dc/oidc-agent/releases/latest "Authorization: Bearer ${token}") -tag=$(echo "$json" | jq -r '.tag_name') +tag=$(echo "${json}" | jq -r '.tag_name') version=${tag/#v/} -"$(dirname "$0")"/updateToRelease.sh "$version" "$1" +"$(dirname "$0")"/updateToRelease.sh "${version}" "$1" diff --git a/updateToRelease.sh b/updateToRelease.sh index c3d372e..7dd00b2 100755 --- a/updateToRelease.sh +++ b/updateToRelease.sh @@ -1,22 +1,27 @@ #!/bin/bash +set -e + token=$(git config --global github.token) export token version=$1 -tag="v$version" +tag="v${version}" formula=$2 -git checkout -b "$version" +git checkout -b "${version}" tar_url=$(echo "https://github.com/indigo-dc/oidc-agent/archive/refs/tags/VTAG.tar.gz" | sed \"s/VTAG/"${tag}"/g\") -sha256=$(curl -L "$tar_url" 2>/dev/null| sha256sum | awk '{print $1}') +wget "${tar_url}" -O /tmp/prerel.tar.gz -q +sha256_output=$(sha256sum /tmp/prerel.tar.gz) +sha256=$(printf "%s" "${sha256_output}" | awk '{print $1}') -sed -i "s!^[[:space:]]*url\ \".*\"! url\ \"${tar_url}\"!g" "$formula" -sed -i "s/sha256\ \".*\"/sha256\ \"${sha256}\"/g" "$formula" +sed -i "s!^[[:space:]]*url\ \".*\"! url\ \"${tar_url}\"!g" "${formula}" +sed -i "s/sha256\ \".*\"/sha256\ \"${sha256}\"/g" "${formula}" echo "Updated url to: ${tar_url}" echo "Updated sha256 to: ${sha256}" -git add "$formula" +git add "${formula}" git commit -m \""${version}"\" +