Update Paddle Submodule NightlyAdd commentMore actions #26
This file contains hidden or 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 Paddle Submodule NightlyAdd commentMore actions | |
| on: | |
| schedule: | |
| - cron: '0 16 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| update-submodule-and-pr: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| token: ${{ secrets.PAT }} | |
| - name: Update Paddle Submodule | |
| run: | | |
| set -x | |
| echo "BRANCH_NAME=update-paddle-submodule-$(date +'%Y%m%d')" >> $GITHUB_ENV | |
| git config --global user.name "tianshuo78520a" | |
| git config --global user.email "tianshuo78520a@users.noreply.github.com" | |
| git submodule deinit -f --all | |
| git submodule update --remote --init | |
| cd Paddle && git checkout develop && git pull origin develop | |
| cd .. | |
| git submodule status | |
| git add Paddle | |
| if [ -z "$(git diff --cached --name-only)" ]; then | |
| echo "No changes to commit in Paddle submodule" | |
| else | |
| git commit -m "Update Paddle submodule to latest develop" | |
| echo "Paddle submodule updated successfully" | |
| fi | |
| echo "=== 最终状态 ===" | |
| git status | |
| echo "=== 子模块状态 ===" | |
| git submodule status | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.PAT }} | |
| branch: ${{ env.BRANCH_NAME }} | |
| delete-branch: true | |
| title: "Nightly Update: Paddle Submodule" | |
| body: "Automated PR to update Paddle submodule to the latest commit." | |
| commit-message: "Update Paddle submodule" | |
| base: develop | |
| labels: "automated,submodule" |