update submodule in response to marketing content update #20
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
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: | |
update | |
push: | |
branches: [main] | |
jobs: | |
update-submodules: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: update nearorg_marketing | |
run: | | |
git submodule init | |
git submodule update --remote --merge | |
- name: Check the diff | |
id: check_diff | |
run: | | |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Log next steps | |
if: steps.check_diff.outputs.changed != 'true' | |
run: | | |
echo "Workflow will make no changes. The submodule is already up-to-date." | |
- name: Conditional Commit | |
if: steps.check_diff.outputs.changed == 'true' | |
run: | | |
echo "Preparing a commit to update the submodule." | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions-bot" | |
git commit -m "update submodule in response to marketing content update" -a | |
git push |