-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See for a live example bilelmoussaoui/gtk4-rs#2
- Loading branch information
1 parent
9bf4186
commit 83d3161
Showing
1 changed file
with
55 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Auto updates | ||
|
||
on: | ||
repository_dispatch: | ||
types: [internal-merge-event] | ||
|
||
jobs: | ||
regen: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout current repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
git submodule update --checkout | ||
- name: Update Git submodules | ||
run: | | ||
cd ./gir && git fetch --all && git reset --hard origin/main && cd ../ | ||
git add . | ||
git diff --cached --exit-code || git commit -m "Update gir" | ||
python generator.py | ||
git add . | ||
git diff --cached --exit-code || git commit -m "Regenerate with latest gir" | ||
cd ./gir-files && git fetch --all && git reset --hard origin/main && cd ../ | ||
git add . | ||
git diff --cached --exit-code || git commit -m "Update gir-files" | ||
python generator.py | ||
git add . | ||
git diff --cached --exit-code || git commit -m "Regenerate with latest gir-files" | ||
- name: Push changes | ||
run: | | ||
git push origin "auto-pr-branch" || echo "Branch already exists" | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: "auto-pr-branch" | ||
title: "Automated PR: Changes from updating gir/gir-files" | ||
body: "This PR contains auto-generated changes after a merge in the external gir-files repository." | ||
commit-message: "Auto-generated changes from updating gir/gir-files" | ||
author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" |