[homebrew-tap-info] Unknown error - Found ) in line 46... #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Homebrew TAP INFO (Workflow) | ||
on: | ||
workflow_call: | ||
inputs: | ||
forced: | ||
description: "Force execution - Default: false" | ||
required: false | ||
type: boolean | ||
default: false | ||
github_actions_artifact_name: | ||
description: "Artifact name for tap information - Default: homebrew-tap-info-json" | ||
required: false | ||
type: string | ||
default: "homebrew-tap-info-json" | ||
jobs: | ||
check_artifact_ref: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
ref: ${{ steps.get-ref.outputs.ref }} | ||
if: ${{ ! inputs.forced }} | ||
steps: | ||
- id: download-artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.github_actions_artifact_name }} | ||
path: ${{ inputs.github_actions_artifact_name }} | ||
- id: get-ref | ||
run: | | ||
echo ref=$(jq -r '.[0]."HEAD"' ${{ inputs.github_actions_artifact_name }}) >> $GITHUB_OUTPUT | ||
check_git_ref: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
ref: ${{ steps.get-ref.outputs.ref }} | ||
if: ${{ ! inputs.forced }} | ||
steps: | ||
- id: get-ref | ||
run: | | ||
echo ref=${{ github.head_ref }} >> $GITHUB_OUTPUT | ||
check_freshness: | ||
runs-on: ubuntu-latest | ||
needs: [ check_artifact_ref, check_git_ref ] | ||
outputs: | ||
go-ahead: ${{ steps.check.outputs.yesno }} | ||
if: ${{ ! inputs.forced }} | ||
steps: | ||
- id: check | ||
run: | | ||
if [[ ${{ inputs.forced }} ]]; then | ||
echo yesno=1 >> $GITHUB_OUTPUT | ||
elif [[ ${{ needs.check_artifact_ref.outputs.ref }} != ${{ needs.check_git_ref.outputs.ref }} ]]; then | ||
echo yesno=1 >> $GITHUB_OUTPUT | ||
else | ||
echo yesno=0 >> $GITHUB_OUTPUT | ||
fi | ||
homebrew_tap_info: | ||
runs-on: ubuntu-latest # macOS-latest? | ||
needs: check_freshness | ||
env: | ||
HOMEBREW_NO_ANALYTICS: 1 | ||
outputs: | ||
homebrew-tap-info-json: ${{ steps.echo.outputs.json }} | ||
if: ${{ inputs.forced || needs.check_freshness.outputs.go-ahead }} | ||
steps: | ||
- id: setup-homebrew | ||
uses: sazriel26/github-actions-sandbox/setup-homebrew-on-github-actions@main | ||
with: | ||
developer-mode: true | ||
- id: homebrew-tap | ||
run: | | ||
brew tap ${{ github.repository }} | ||
- id: homebrew-tap-info | ||
run: | | ||
brew tap-info --json ${{ github.repository }} \ | ||
> ${{ inputs.github_actions_artifact_name }} | ||
- id: upload-artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.github_actions_artifact_name }} | ||
path: ${{ inputs.github_actions_artifact_name }} | ||
overwrite: true | ||
- id: echo | ||
run: | | ||
json=$(< ${{ inputs.github_actions_artifact_name }}) | ||
echo json=${json} >> $GITHUB_OUTPUT | ||
# EoF |