name: Updating to latest Homebrewery Release on: schedule: - cron: '0 9,17 * * *' workflow_dispatch: concurrency: group: "update-homebrewery" cancel-in-progress: true permissions: contents: write jobs: update: runs-on: ubuntu-24.04 steps: - name: Get latest Homebrewery release via GitHub API run: | # 1) API-Call resp=$(curl -sSf \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token ${{ secrets.GH_TOKEN }}" \ https://api.github.com/repos/naturalcrit/homebrewery/releases/latest) id=$( echo "$resp" | jq -r .id) tag_name=$( echo "$resp" | jq -r .tag_name) name=$( echo "$resp" | jq -r .name) url=$( echo "$resp" | jq -r .url) draft=$( echo "$resp" | jq -r .draft) prerelease=$( echo "$resp" | jq -r .prerelease) body_text=$( echo "$resp" | jq -r .body) echo "ID=$id" >>"$GITHUB_ENV" echo "TAG_NAME=$tag_name" >>"$GITHUB_ENV" echo "NAME=$name" >>"$GITHUB_ENV" echo "URL=$url" >>"$GITHUB_ENV" echo "DRAFT=$draft" >>"$GITHUB_ENV" echo "PRERELEASE=$prerelease" >>"$GITHUB_ENV" read -r -d '' RELEASE_BODY < _This is an automated Docker Image update. Nothing other than the Homebrewery version changed._ $body_text See original Changelog from [$name]($url) EOF echo "RELEASE_BODY<>"$GITHUB_ENV" printf '%s\n' "$RELEASE_BODY" >>"$GITHUB_ENV" echo "EOF" >>"$GITHUB_ENV" - name: Debug step run: | echo "id: $ID" echo "draft: $DRAFT" echo "tag_name: $TAG_NAME" echo "name: $NAME" echo "url: $URL" echo "prerelease: $PRERELEASE" - name: Create Docker Release uses: softprops/action-gh-release@v2 if: ${{ env.ID > 0 && env.DRAFT != 'true' }} with: prerelease: ${{ env.PRERELEASE }} name: ${{ env.NAME }} tag_name: ${{ env.TAG_NAME }} body: ${{ env.RELEASE_BODY }}