Submodules Sync #210
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: 'Submodules Sync' | |
on: | |
# Allows you to run this workflow manually from the Actions tab or through HTTP API | |
workflow_dispatch: | |
jobs: | |
sync: | |
name: 'Submodules Sync' | |
runs-on: ubuntu-latest | |
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
# Checkout the repository to the GitHub Actions runner | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax | |
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
# Update references | |
- name: Git Submodule Update | |
run: | | |
git pull --recurse-submodules | |
git submodule foreach git pull --ff-only origin main | |
- name: Commit update | |
run: | | |
git config --global user.name 'Git bot' | |
git config --global user.email '[email protected]' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
cp tpdb/settings.py.example tpdb/settings.py | |
poetry install | |
poetry run python3 generate.py | |
rm tpdb/settings.py | |
git commit -am "Auto updated submodule references" && git push || echo "No changes to commit" |