Skip to content

Commit

Permalink
fix warnings/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmann committed Aug 20, 2024
1 parent 0f2a492 commit 170f868
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@

## How do I install these formulae?

`brew install indigo-dc/oidc-agent/<formula>`
```
brew install indigo-dc/oidc-agent/<formula>
```
i.e.
```
brew install indigo-dc/oidc-agent/oidc-agent

Check failure on line 10 in README.md

View workflow job for this annotation

GitHub Actions / test-bot (macos-12)

Wrap expressions with varying precedence with parentheses to avoid ambiguity.

Check failure on line 10 in README.md

View workflow job for this annotation

GitHub Actions / test-bot (macos-12)

Wrap expressions with varying precedence with parentheses to avoid ambiguity.

Check failure on line 10 in README.md

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Wrap expressions with varying precedence with parentheses to avoid ambiguity.

Check failure on line 10 in README.md

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Wrap expressions with varying precedence with parentheses to avoid ambiguity.
```

Or `brew tap indigo-dc/oidc-agent` and then `brew install <formula>`, i.e.

```
brew tap indigo-dc/oidc-agent

Check failure on line 16 in README.md

View workflow job for this annotation

GitHub Actions / test-bot (macos-12)

Wrap expressions with varying precedence with parentheses to avoid ambiguity.

Check failure on line 16 in README.md

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

Wrap expressions with varying precedence with parentheses to avoid ambiguity.
brew install oidc-agent
``````
```

## Documentation
Expand Down
6 changes: 4 additions & 2 deletions updateToNewestRelease.sh
Original file line number Diff line number Diff line change
@@ -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"
17 changes: 11 additions & 6 deletions updateToRelease.sh
Original file line number Diff line number Diff line change
@@ -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}"\"

0 comments on commit 170f868

Please sign in to comment.