Update Submodule Changes #11
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 Submodule Changes | |
# Trigger the workflow on push events to Dependabot branches | |
on: | |
push: | |
branches: | |
- 'dependabot/**' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update-file-after-submodule: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Run Update Script | |
run: | | |
chmod +x ./update_repo.py | |
./update_repo.py | |
- name: Configure Git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "[email protected]" | |
- name: Commit Changes | |
run: | | |
git add . | |
git commit -m "Update file after submodule update" || echo "No changes to commit" | |
- name: Configure Git Pull Strategy | |
run: git config pull.rebase true | |
- name: Pull latest changes | |
run: git pull origin main | |
- name: Push Changes | |
run: | | |
git push origin HEAD:update-file-after-submodule | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: "Update file after submodule update" | |
title: "Update File After Submodule Update" | |
body: | | |
This pull request updates the relevant files after a submodule update by Dependabot. | |
base: main | |
head: update-file-after-submodule | |