Skip to content

Commit

Permalink
Create PR instead of commiting directly when updating bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
pheki committed Jul 15, 2023
1 parent 46f23ec commit 215f8ea
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/update-bindings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update bindings
name: Create PR to update bindings

on:
workflow_dispatch:
Expand Down Expand Up @@ -56,6 +56,7 @@ jobs:
- name: Update vita-headers
run: |
git submodule update --recursive --remote generator/vita-headers
echo "VITA_HEADERS_HASH=$(git submodule status | grep generator/vita-headers | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: Regenerate bindings
env:
Expand All @@ -69,17 +70,13 @@ jobs:
cd ..
cargo fmt
- name: Commit
env:
# Required by Github CLI (`gh`)
GH_TOKEN: ${{ github.token }}
# Do not fail when there's nothing to commit
continue-on-error: true
run: |
git add .
git config user.name github-actions
git config user.email [email protected]
VITA_HEADERS_HASH=$(git submodule status | grep generator/vita-headers | cut -d ' ' -f 2)
git commit -m "Update vita-headers to $VITA_HEADERS_HASH"
git push
gh workflow run build-example.yml --ref ${GITHUB_REF}
- name: Commit and create pull request
uses: peter-evans/create-pull-request@v5
with:
title: Update vita-headers bindings
body: Created by the action at [/.workflows/update-bindings.yml](../tree/main/.workflows/update-bindings.yml)
branch: update-bindings
delete-branch: true
commit-message: Update vita-headers to ${{ env.VITA_HEADERS_HASH }}
committer: github-actions <[email protected]>
assignees: pheki

0 comments on commit 215f8ea

Please sign in to comment.