-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create PR instead of commiting directly when updating bindings
- Loading branch information
Showing
1 changed file
with
12 additions
and
15 deletions.
There are no files selected for viewing
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
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: | ||
|
@@ -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: | ||
|
@@ -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 |