Skip to content

📩 Self-Update

📩 Self-Update #1059

Workflow file for this run

name: '📩 Self-Update'
on:
# Once a day, check to see if there have been changes to the template project.
schedule:
# Since our package template updates automatically, this ensures it will
# never be unreleased for more than a day.
- cron: 0 0 * * * # end of every day
workflow_dispatch:
inputs:
bump:
description: 'Bump type'
required: true
default: 'patch'
type: choice
options:
- 'major'
- 'minor'
- 'patch'
jobs:
self_update:
name: '📩 Self-Update'
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.changes.outputs.changed }}
steps:
- name: '🧾 Checkout'
uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: true
token: ${{ secrets.GH_BASIC }}
ref: ${{ github.ref }}
- name: '🌏 Update Submodules'
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: '👀 See If Anything Changed'
id: changes
run: |
if [[ $(git status --porcelain) ]]; then
echo "Detected changes in repository."
echo "changed=1" >> $GITHUB_OUTPUT
else
echo "No changes in repository."
echo "changed=0" >> $GITHUB_OUTPUT
fi
- name: ✍️ Commit Changes
if: steps.changes.outputs.changed == 1
run: |
git config user.name "action@github.com"
git config user.email "GitHub Action"
git commit -a -m "chore(version): update submodules"
git push
release:
uses: './.github/workflows/release.yaml'
needs: self_update
if: needs.self_update.outputs.changed == 1
secrets:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
GH_BASIC: ${{ secrets.GH_BASIC }}
with:
bump: ${{ inputs.bump || 'patch' }}