Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,11 @@ jobs:

regenerate-single-include:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: '3.x'
Expand All @@ -120,12 +119,15 @@ jobs:
--source-dir include \
--source-dir mgutility/include \
--output single_include/mgutility_enum_name.hpp
- name: Commit and push if changed
run: |
git diff --quiet single_include/mgutility_enum_name.hpp || {
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add single_include/mgutility_enum_name.hpp
git commit -m "Auto-regenerate single-include header"
git push
}
- name: Create Pull Request if changed
uses: peter-evans/create-pull-request@v7
with:
add-paths: single_include/mgutility_enum_name.hpp
commit-message: "Auto-regenerate single-include header"
branch: auto-update/single-include
title: "chore: auto-regenerate single-include header"
body: |
Automated regeneration of `single_include/mgutility_enum_name.hpp`
from source headers after recent changes to `${{ github.ref }}`.
delete-branch: true
token: ${{ secrets.GITHUB_TOKEN }}
Loading