Skip to content

Commit

Permalink
🔧 Tried fixing update-formula job by checking out main with `acti…
Browse files Browse the repository at this point in the history
…ons/checkout`
  • Loading branch information
gy-mate committed Jun 4, 2024
1 parent f35e102 commit 4d84709
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Update Homebrew formula

on:
release:
types: [ published ]
types: [published]

jobs:
update-formula:
Expand All @@ -11,6 +11,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: 'main'

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -32,11 +35,10 @@ jobs:
TAG_NAME=${GITHUB_REF/refs\/tags\//}
TAR_URL=https://github.com/gy-mate/homebrew-moodle-to-vikwikiquiz/archive/refs/tags/$TAG_NAME.tar.gz
SHA256=$(curl -L $TAR_URL | sha256sum | cut -d' ' -f1)
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout main
sed -i "s|url \".*\"|url \"$TAR_URL\"|" $FORMULA_PATH
sed -i "s|sha256 \".*\"|sha256 \"$SHA256\"|" $FORMULA_PATH
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add $FORMULA_PATH
git commit -m "Updated formula for release ${{ github.event.release.tag_name }}"
git push
Expand Down

0 comments on commit 4d84709

Please sign in to comment.