fix sed #2
Workflow file for this run
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: Update Renterd Formula | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'vDEBUG' | |
# Run hourly | |
schedule: | |
- cron: '0 * * * *' | |
# Enable manual trigger | |
workflow_dispatch: | |
jobs: | |
update-formula: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout respository | |
uses: actions/checkout@v3 | |
- name: Check for new renterd tag in SiaFoundation/renterd | |
id: check-tag | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
# Fetch tags with pagination | |
TAGS_JSON=$(gh api --paginate repos/SiaFoundation/renterd/tags) | |
# Extract tags that start with "renterd/", sort them in version order, and pick the highest version | |
LATEST_RENTERD_GO_TAG=$(echo "$TAGS_JSON" | jq -r '.[] | select(.name | startswith("v")).name' | sort -Vr | head -n 1) | |
LATEST_RENTERD_VERSION=$(echo "$LATEST_RENTERD_GO_TAG") | |
echo "Latest renterd tag is $LATEST_RENTERD_GO_TAG" | |
echo "GO_TAG=$LATEST_RENTERD_GO_TAG" >> $GITHUB_ENV | |
echo "VERSION=$LATEST_RENTERD_VERSION" >> $GITHUB_ENV | |
- name: Update Homebrew Formula | |
run: sed -i 's/:tag => "[^"]*"/:tag => "${{ env.GO_TAG }}"/' ./Formula/renterd.rb | |
- name: Create Pull Request | |
uses: peter-evans/[email protected] | |
with: | |
token: ${{ secrets.HOMEBREW_CREATE_PR }} | |
commit-message: 'renterd: ${{ env.GO_TAG }}' | |
title: 'renterd: ${{ env.GO_TAG }}' | |
body: 'This is an automated PR to update the formula of renterd' | |
branch: renterd/update | |
base: master |