Skip to content

Update Submodules #2732

Update Submodules

Update Submodules #2732

name: Update Submodules
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# We do it every 6 hours.
schedule:
- cron: '0 */6 * * *'
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: tgstation/map_depot
token: ${{ secrets.WRITE_SECRET }}
- name: Pull & update submodules recursively
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Commit
run: |
git config user.email "[email protected]"
git config user.name "Submodule Updater"
git add --all
git commit -m "Submodule Update - Discard Any Changes" || echo "No Changes To Commit"
git push
# The reason why we say "Discard Any Changes" is because sometimes, when you merge master in your branch,
# Git may assume that you want to change the submodule commit from whatever is on your machine
# to the one that we have on master. So, this is a helpful reminder to all those who contribute
# that they should discard any changes to this file before they commit. Also, discarding this change
# does mean that you will actually be on the most recent commit in the tgstation submodule.
# If you do not discard your change, your submodule will not be in-date.
# This is a pretty awkward place to put it, but I just figured it out after an hour of sweating here
# and I want to make sure I can get back to it later.
#
# -san7890