Added 8 new personas ↞ [auto-sync from https://github.com/KudoAI/ai-p… #159
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 README.md between ai-personas/ ⟷ ai-personas/docs/, then ai-personas/ to KudoAI/ai-personas/node.js/ | |
| on: | |
| push: | |
| branches: [main] | |
| paths: [ai-personas/**] | |
| jobs: | |
| build: | |
| if: (github.repository == 'adamlui/js-utils') && !contains(github.event.head_commit.message, '[auto-sync') | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| env: | |
| TZ: PST8PDT | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| token: ${{ secrets.REPO_SYNC_PAT }} | |
| path: adamlui/js-utils | |
| fetch-depth: 2 | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| token: ${{ secrets.REPO_SYNC_PAT }} | |
| repository: KudoAI/ai-personas | |
| path: KudoAI/ai-personas | |
| - run: | | |
| cd ${{ github.workspace }}/adamlui/js-utils | |
| root_readme="./ai-personas/README.md" | |
| root_readme_content=$(git show HEAD:"$root_readme") | |
| root_readme_modified=$(git log -1 --format="%ct" -- "$root_readme") | |
| docs_readme="./ai-personas/docs/README.md" | |
| docs_readme_content=$(git show HEAD:"$docs_readme") | |
| docs_readme_modified=$(git log -1 --format="%ct" -- "$docs_readme") | |
| if [[ "$root_readme_content" != "$docs_readme_content" ]] ; then | |
| if (( $root_readme_modified > $docs_readme_modified )) ; then | |
| cp -f "$root_readme" "$docs_readme" | |
| echo "Copied $root_readme to $docs_readme" | |
| src_folder="/ai-personas" | |
| elif (( $docs_readme_modified > $root_readme_modified )) ; then | |
| cp -f "$docs_readme" "$root_readme" | |
| echo "Copied $docs_readme to $root_readme" | |
| src_folder="/ai-personas/docs" | |
| fi | |
| fi | |
| echo "SYNC_SRC=$src_folder" >> $GITHUB_ENV | |
| - run: | | |
| rsync -avhc --delete \ | |
| ${{ github.workspace }}/adamlui/js-utils/ai-personas/ \ | |
| ${{ github.workspace }}/KudoAI/ai-personas/node.js/ | |
| - env: | |
| COMMIT_MSG: ${{ github.event.head_commit.message }} | |
| run: | | |
| DELIM="EOF_$(uuidgen)" | |
| echo "ESCAPED_MSG<<$DELIM" >> "$GITHUB_ENV" | |
| echo "$COMMIT_MSG" | sed 's/`/\`/g' >> "$GITHUB_ENV" | |
| echo "$DELIM" >> "$GITHUB_ENV" | |
| - 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 "auto-sync@kudoai.com" | |
| git config --global user.signingkey "$GPG_PRIVATE_ID" | |
| - if: env.SYNC_SRC | |
| run: | | |
| cd ${{ github.workspace }}/adamlui/js-utils | |
| git add . && git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from $SYNC_SRC]" || true | |
| git pull --rebase | |
| git push | |
| - run: | | |
| cd ${{ github.workspace }}/KudoAI/ai-personas | |
| git add . && git commit -n -m \ | |
| "$ESCAPED_MSG ↞ [auto-sync from https://github.com/adamlui/js-utils/tree/main/ai-personas]" || true | |
| git pull --rebase | |
| git push |