Skip to content

Mitigated super-linear backtracking in regex ↞ [auto-sync from `KudoA… #230

Mitigated super-linear backtracking in regex ↞ [auto-sync from `KudoA…

Mitigated super-linear backtracking in regex ↞ [auto-sync from `KudoA… #230

name: Sync ** to KudoAI/chatgpt.js/starters/chrome/
on:
push:
branches: [main]
paths: ["**", "!.*", "!package*json", "!eslint.config*"]
jobs:
build:
if: (github.repository == 'KudoAI/chatgpt.js-chrome-starter') && (github.event.commits[0].committer.username != 'kudo-sync-bot')
runs-on: ubuntu-latest
env:
TZ: PST8PDT
steps:
- name: Checkout KudoAI/chatgpt.js-chrome-starter
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: KudoAI/chatgpt.js-chrome-starter
path: KudoAI/chatgpt.js-chrome-starter
- name: Checkout KudoAI/chatgpt.js
uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_SYNC_PAT }}
repository: KudoAI/chatgpt.js
path: KudoAI/chatgpt.js
- name: Sync ** to KudoAI/chatgpt.js/starters/chrome/
run: |
rsync -avhr --delete --exclude={'.*','eslint*','package*json'} \
"${{ github.workspace }}/KudoAI/chatgpt.js-chrome-starter/" \
"${{ github.workspace }}/KudoAI/chatgpt.js/starters/chrome/"
- name: Config committer
run: |
gpg --batch --import <(echo "${{ secrets.GPG_PRIVATE_KEY }}")
git config --global commit.gpgsign true
git config --global user.name "kudo-sync-bot"
git config --global user.email "[email protected]"
git config --global user.signingkey "${{ secrets.GPG_PRIVATE_ID }}"
- 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/chatgpt.js
run: |
cd ${{ github.workspace }}/KudoAI/chatgpt.js
git add .
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`KudoAI/chatgpt.js-chrome-starter\`]" || true
git push