sync-theme #11407
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: | |
schedule: | |
- cron: '0 6 * * 0' # Run once per week at 6am UTC on Sundays. | |
name: sync-theme | |
jobs: | |
sync-theme: | |
name: sync theme | |
runs-on: ubuntu-latest | |
steps: | |
- name: Copy Latest Theme | |
shell: bash | |
env: | |
TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
run: | | |
git config --global user.name "$GITHUB_ACTOR" | |
git config --global user.email "[email protected]" | |
echo "Cloning create-mantle-app..." | |
git clone --depth=1 https://[email protected]/alleyinteractive/create-mantle-app.git create-mantle-app | |
echo "Cloning theme..." | |
git clone --depth=1 https://github.com/WordPress/WordPress.git wordpress | |
echo "Removing old theme..." | |
rm -rf create-mantle-app/themes/twentytwentyone | |
echo "Replacing theme..." | |
mv wordpress/wp-content/themes/twentytwentyone create-mantle-app/themes/twentytwentyone | |
cd create-mantle-app/themes | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "No changes" | |
else | |
echo "Committing..." | |
git add -A | |
git commit -m "Syncing twentytwentyone" | |
git push | |
fi |