Skip to content

Moved CSS props away from selector lines of multi-line blocks for rea… #348

Moved CSS props away from selector lines of multi-line blocks for rea…

Moved CSS props away from selector lines of multi-line blocks for rea… #348

Workflow file for this run

name: Sync (/ to adamlui/chatgpt-apps/amazongpt/) && (/greasemonkey/ to adamlui/userscripts/chatgpt/amazongpt/)
on:
push:
branches: [main]
paths: ["**", "!.*", "!package*json", "!eslint.config*"]
jobs:
build:
if: (github.repository == 'KudoAI/amazongpt') && (github.event.commits[0].committer.username != 'kudo-sync-bot')
runs-on: ubuntu-latest
env:
GIT_AUTHOR_NAME: ${{ github.event.commits[0].author.name }}
GIT_AUTHOR_EMAIL: ${{ github.event.commits[0].author.email }}
GIT_COMMITTER_NAME: kudo-sync-bot
GIT_COMMITTER_EMAIL: [email protected]
steps:
- name: Checkout KudoAI/amazongpt
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: KudoAI/amazongpt
path: KudoAI/amazongpt
fetch-depth: 2
- name: Checkout adamlui/chatgpt-apps
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: adamlui/chatgpt-apps
path: adamlui/chatgpt-apps
- name: Checkout adamlui/userscripts
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: adamlui/userscripts
path: adamlui/userscripts
- name: Sync docs between root & /greasemonkey
id: sync_docs
run: |
shopt -s globstar
cd ${{ github.workspace }}/KudoAI/amazongpt
loc_prefixes=( "root" "gm" )
# Sync LICENSE.md
for prefix in "${loc_prefixes[@]}" ; do
eval "${prefix}_license_content=\$(git show HEAD:\"./\$([[ \$prefix == \"gm\" ]] && echo \"greasemonkey/\" || echo \"\")LICENSE.md\")"
eval "${prefix}_license_modified=\$(git log -1 --format=\"%ct\" -- \"\$([[ \$prefix == \"gm\" ]] && echo \"greasemonkey/\" || echo \"\")LICENSE.md\")"
done
if (( root_license_modified > gm_license_modified )) ; then
if [[ "$root_license_content" != "$gm_license_content" ]] ; then
cp -f "LICENSE.md" "greasemonkey/LICENSE.md" ; sync_src="root" ; fi
elif (( gm_license_modified > root_license_modified )) ; then
if [[ "$gm_license_content" != "$root_license_content" ]] ; then
cp -f "greasemonkey/LICENSE.md" "LICENSE.md" ; sync_src="greasemonkey" ; fi ; fi
# Sync other docs
for file in docs/**/*.md ; do
for prefix in "${loc_prefixes[@]}" ; do
eval "${prefix}_doc_path=\"./\$([[ \$prefix == \"gm\" ]] && echo \"greasemonkey/\" || echo \"\")docs/${file#"docs/"}\""
eval "${prefix}_doc_content=\$(git show HEAD:\"\$${prefix}_doc_path\")"
eval "${prefix}_doc_modified=\$(git log -1 --format=\"%ct\" -- \"\$${prefix}_doc_path\")"
done
if (( root_doc_modified > gm_doc_modified )) ; then
if [[ "$root_doc_content" != "$gm_doc_content" ]] ; then
cp -f "$root_doc_path" "$gm_doc_path" ; sync_src="root" ; fi
elif (( gm_doc_modified > root_doc_modified )) ; then
if [[ "$gm_doc_content" != "$root_doc_content" ]] ; then
cp -f "$gm_doc_path" "$root_doc_path" ; sync_src="greasemonkey" ; fi ; fi
done
# Store sync src for commit msg in self-push step
echo "sync_src=$sync_src" >> $GITHUB_OUTPUT
- name: Sync / to adamlui/chatgpt-apps/amazongpt/
run: |
rsync -avhr --delete --exclude={'.*','eslint*','package*json'} \
${{ github.workspace }}/KudoAI/amazongpt/ \
${{ github.workspace }}/adamlui/chatgpt-apps/amazongpt/
- name: Sync /greasemonkey/ to adamlui/userscripts/chatgpt/amazongpt/
run: |
rsync -avhr --delete \
${{ github.workspace }}/KudoAI/amazongpt/greasemonkey/ \
${{ github.workspace }}/adamlui/userscripts/chatgpt/amazongpt/
- name: Escape backticks in commit msg
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
echo "ESCAPED_MSG<<EOF" >> $GITHUB_ENV
echo "$COMMIT_MSG" | sed 's/`/\`/g' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Push changes to KudoAI/amazongpt
run: |
cd ${{ github.workspace }}/KudoAI/amazongpt
git add .
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`${{ steps.sync_docs.outputs.sync_src }}\`]" || true
git push
- name: Push changes to adamlui/chatgpt-apps
run: |
cd ${{ github.workspace }}/adamlui/chatgpt-apps
git add .
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`KudoAI/amazongpt\`]" || true
git push
- name: Push changes to adamlui/userscripts
run: |
cd ${{ github.workspace }}/adamlui/userscripts
git add .
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`KudoAI/amazongpt\`]" || true
git push