chore(deps): update dependency knope to v0.18.2 #91
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 Formula | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/update-formula.yml | |
jobs: | |
update-sha: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.PAT }} | |
fetch-depth: 0 | |
- name: Download Knope Source | |
run: curl -o source.tgz https://codeload.github.com/knope-dev/knope/tar.gz/refs/tags/knope/v0.18.2 | |
- name: Get new SHA | |
run: echo "NEW_SHA=$(shasum -a 256 source.tgz | cut -d ' ' -f 1)" >> "$GITHUB_ENV" | |
- name: Update Formula | |
id: update-formula | |
run: sed -i "s#^ sha256 .*# sha256 \"${{ env.NEW_SHA }}\"#" Formula/knope.rb | |
- name: Check if SHA changed | |
id: check-sha | |
run: echo "changed=$(git diff --exit-code Formula/knope.rb > /dev/null && echo no || echo yes)" >> "$GITHUB_OUTPUT" | |
- name: Commit back new SHA if it changed | |
if: steps.check-sha.outputs.changed == 'yes' | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git switch -C release | |
git add Formula/knope.rb | |
git commit --amend --reuse-message HEAD | |
git push --force --set-upstream origin release | |
- name: Open a new PR | |
if: steps.check-sha.outputs.changed == 'yes' | |
run: gh pr create --fill --label "release" | |
env: | |
GH_TOKEN: ${{ secrets.PAT }} |