Added Latest Build shield link to sed_actions
#4
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: Sync changes between **/bump.sh | |
on: | |
push: | |
branches: main | |
paths: "**/bump.sh" | |
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: Sync changes between **/bump.sh | |
id: sync_changes | |
run: | | |
cd ${{ github.workspace }}/adamlui/minify.js | |
# Find the newest bump.sh | |
files=$(find . -name "bump.sh" -type f) | |
newest_file="" ; newest_timestamp=0 | |
for file in $files ; do | |
timestamp=$(git log -1 --format="%ct" -- "$file") | |
if [[ $timestamp -gt $newest_timestamp ]] ; then | |
newest_file=$file ; newest_timestamp=$timestamp | |
fi ; done | |
# Copy/paste over all other bump.sh files | |
if [[ -n $newest_file ]] ; then | |
for file in $files ; do | |
if [[ $file != $newest_file ]] ; then | |
cp -f "$newest_file" "$file" | |
fi ; done ; fi | |
# Store sync src for commit msg in next step | |
sync_src=$(echo "$newest_file" | cut -d'/' -f2-3) | |
echo "sync_src=$sync_src" >> $GITHUB_OUTPUT | |
- 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_changes.outputs.sync_src }}`]" | |
file_pattern: "**" | |
repository: adamlui/minify.js |