Merge pull request #111 from hjdivad/hjdivad/automerge-update-types #7
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 Types" | |
permissions: | |
contents: write | |
pull-requests: write | |
on: | |
push: | |
branches: | |
- "master" | |
paths: | |
- "packages/binutils/crates/global/src/vadnu/config.rs" | |
- "packages/binutils/crates/global/src/bin/generate-lua-types.rs" | |
- ".github/workflows/generate-types.yaml" | |
workflow_dispatch: | |
jobs: | |
update-schema: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: | | |
# ensure the local-crates symlink is not broken, else cargo will | |
# refuse to do anything | |
mkdir -p local-packages/crates | |
cargo \ | |
run \ | |
--manifest-path packages/binutils/Cargo.toml \ | |
--bin generate-lua-types \ | |
-- \ | |
--input packages/binutils/crates/global/src/vadnu/config.rs \ | |
--output packages/binutils/crates/global/vadnu-sync.lua | |
- name: Commit New Types | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add -f packages/binutils/crates/global/vadnu-sync.lua | |
if git diff --cached --quiet; then | |
echo "No changes to commit" | |
else | |
git commit -m 'Update vadnu-sync Lua types' | |
fi | |
- name: Create Pull Request | |
# see <https://github.com/peter-evans/create-pull-request#action-inputs> | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: 'chore(bot): Update vadnu-sync Lua types' | |
title: 'Update vadnu-sync Lua types' | |
body: 'This PR updates the vadnu-sync Lua types.' | |
branch: 'gha/update-lua-types' | |
labels: 'automerge' | |
author: 'github-actions[bot] <github-actions[bot]@users.noreply.github.com>' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
delete-branch: true | |
draft: false | |
- name: Automerge PR | |
run: | | |
gh pr merge --merge --auto |