Update submodule pointer #3
Workflow file for this run
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 submodule pointer | |
| on: | |
| repository_dispatch: | |
| types: [submodule-updated] | |
| workflow_dispatch: | |
| concurrency: | |
| group: update-submodule | |
| cancel-in-progress: true | |
| jobs: | |
| update-submodule: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout dev branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: dev | |
| submodules: true | |
| # Use default GITHUB_TOKEN — has push access to the repo | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update submodule to latest dev | |
| run: | | |
| cd plugins/temporal-developer/skills/temporal-developer | |
| git fetch origin dev | |
| git checkout FETCH_HEAD | |
| cd "$GITHUB_WORKSPACE" | |
| - name: Check for changes | |
| id: check | |
| run: | | |
| if git diff --quiet; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create PR and merge | |
| if: steps.check.outputs.changed == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| branch="auto/update-submodule-$(date +%s)" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git checkout -b "$branch" | |
| git add plugins/temporal-developer/skills/temporal-developer | |
| git commit -m "update submodule to latest dev" | |
| git push origin "$branch" | |
| pr_url=$(gh pr create --base dev --head "$branch" \ | |
| --title "update submodule to latest dev" \ | |
| --body "Automated submodule pointer update.") | |
| gh pr merge "$pr_url" --squash --auto --delete-branch |