Skip to content

Updated sponsor banner src URL paths #79

Updated sponsor banner src URL paths

Updated sponsor banner src URL paths #79

name: Sync README.md between gulp/ and gulp/docs/, then gulp/* to adamlui/js-utils/minify.js/gulp/*
on:
push:
branches: [main]
paths: [gulp/**]
jobs:
build:
if: (github.repository == 'adamlui/minify.js') && (github.event.commits[0].committer.username != 'kudo-sync-bot')
runs-on: ubuntu-latest
steps:
- name: Checkout adamlui/minify.js
uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: adamlui/minify.js
path: adamlui/minify.js
fetch-depth: 2
- name: Checkout adamlui/js-utils
uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: adamlui/js-utils
path: adamlui/js-utils
- name: Sync README.md between gulp/ and gulp/docs
id: sync_readmes
run: |
cd ${{ github.workspace }}/adamlui/minify.js
# Init paths/content/mod timestamps
root_readme="./gulp/README.md"
root_readme_content=$(git show HEAD:"$root_readme")
root_readme_modified=$(git log -1 --format="%ct" -- "$root_readme")
docs_readme="./gulp/docs/README.md"
docs_readme_content=$(git show HEAD:"$docs_readme")
docs_readme_modified=$(git log -1 --format="%ct" -- "$docs_readme")
# Perform syncs of diff READMEs
if [[ "$root_readme_content" != "$docs_readme_content" ]] ; then
if [[ $root_readme_modified -gt $docs_readme_modified ]] ; then
cp -f "$root_readme" "$docs_readme"
echo "Copied $root_readme to $docs_readme"
src_folder="/gulp"
elif [[ $docs_readme_modified -gt $root_readme_modified ]] ; then
cp -f "$docs_readme" "$root_readme"
echo "Copied $docs_readme to $root_readme"
src_folder="/gulp/docs"
fi
fi
# Store sync src for commit msg in self-push step
echo "sync_src=$src_folder" >> $GITHUB_OUTPUT
- name: Sync gulp/* to adamlui/js-utils/minify.js/gulp/*
run: |
rsync -avhr --delete \
${{ github.workspace }}/adamlui/minify.js/gulp/ \
${{ github.workspace }}/adamlui/js-utils/minify.js/gulp/
- name: Push to adamlui/minify.js
uses: stefanzweifel/git-auto-commit-action@v4
with:
push_options: --force
add_options: --all
commit_user_email: auto-sync@kudoai.com
commit_message: "${{ github.event.head_commit.message }} ↞ [auto-sync from `${{ steps.sync_readmes.outputs.sync_src }}`]"
file_pattern: "gulp/**"
repository: adamlui/minify.js
- name: Push to adamlui/js-utils
uses: stefanzweifel/git-auto-commit-action@v4
with:
push_options: --force
add_options: --all
commit_user_email: auto-sync@kudoai.com
commit_message: "${{ github.event.head_commit.message }} ↞ [auto-sync from `adamlui/minify.js/gulp`]"
file_pattern: "minify.js/gulp/**"
repository: adamlui/js-utils