Merge pull request #240 from adamlui/dependabot/npm_and_yarn/dev-depe… #223
This file contains hidden or 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 ** to adamlui/ai-web-extensions/perplexity-omnibox/ | |
| on: | |
| push: | |
| branches: [main] | |
| paths: ["**", "!.*"] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| if: (github.repository == 'adamlui/perplexity-omnibox') && (github.event.commits[0].committer.username != 'kudo-sync-bot') | |
| runs-on: ubuntu-latest | |
| env: | |
| TZ: PST8PDT | |
| steps: | |
| - name: Checkout adamlui/perplexity-omnibox | |
| uses: actions/[email protected] | |
| with: | |
| path: adamlui/perplexity-omnibox | |
| - name: Checkout adamlui/ai-web-extensions | |
| uses: actions/[email protected] | |
| with: | |
| token: ${{ secrets.REPO_SYNC_PAT }} | |
| repository: adamlui/ai-web-extensions | |
| path: adamlui/ai-web-extensions | |
| - name: Sync ** to adamlui/ai-web-extensions/perplexity-omnibox/ | |
| run: | | |
| rsync -avhr --delete --exclude '.*' \ | |
| ${{ github.workspace }}/adamlui/perplexity-omnibox/ \ | |
| ${{ github.workspace }}/adamlui/ai-web-extensions/perplexity-omnibox/ | |
| - 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: Config committer | |
| env: | |
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| GPG_PRIVATE_ID: ${{ secrets.GPG_PRIVATE_ID }} | |
| run: | | |
| gpg --batch --import <(echo "$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 "$GPG_PRIVATE_ID" | |
| - name: Push changes to adamlui/ai-web-extensions | |
| run: | | |
| cd ${{ github.workspace }}/adamlui/ai-web-extensions | |
| git add . | |
| git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from https://github.com/adamlui/perplexity-omnibox]" || true | |
| git push |