Skip to content

Commit

Permalink
Eliminated potential for malicious code injection
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Aug 14, 2024
1 parent 6f46dc5 commit a282feb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/sync-chatgpt.js-changes-to-chrome-starter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ jobs:
cd "${{ github.workspace }}/KudoAI/chatgpt.js-chrome-starter/extension"
sed -i -E "s/\"version\": \"([0-9]+\.[0-9]+\.[0-9]+)\.*([0-9]*)\"/\"version\": \"$(date +'%Y.%-m.%-d')\"/g" manifest.json
- name: Escape backticks in commit msg
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
echo "ESCAPED_MSG=$(echo "$COMMIT_MSG" | sed 's/`/\`/g')" >> $GITHUB_ENV
- name: Push changes to KudoAI/chatgpt.js
run: |
cd ${{ github.workspace }}/KudoAI/chatgpt.js
git config --global user.name "kudo-sync-bot"
git config --global user.email "auto-sync@kudoai.com"
git add .
git commit -n -m "$(echo '${{ github.event.head_commit.message }}' | sed 's/`/\`/g') ↞ [auto-sync from \`KudoAI/chatgpt.js\`]" || true
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`KudoAI/chatgpt.js\`]" || true
git push
- name: Push changes to KudoAI/chatgpt.js-chrome-starter
Expand All @@ -57,5 +63,5 @@ jobs:
git config --global user.name "kudo-sync-bot"
git config --global user.email "auto-sync@kudoai.com"
git add .
git commit -n -m "$(echo '${{ github.event.head_commit.message }}' | sed 's/`/\`/g')↞ [auto-sync from \`KudoAI/chatgpt.js\`]" || true
git commit -n -m "$ESCAPED_MSG↞ [auto-sync from \`KudoAI/chatgpt.js\`]" || true
git push
8 changes: 7 additions & 1 deletion .github/workflows/sync-chrome-starter-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ jobs:
"${{ github.workspace }}/KudoAI/chatgpt.js/starters/chrome/" \
"${{ github.workspace }}/KudoAI/chatgpt.js-chrome-starter/"
- name: Escape backticks in commit msg
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
echo "ESCAPED_MSG=$(echo "$COMMIT_MSG" | sed 's/`/\`/g')" >> $GITHUB_ENV
- name: Push changes to KudoAI/chatgpt.js-chrome-starter
run: |
cd ${{ github.workspace }}/KudoAI/chatgpt.js-chrome-starter
git config --global user.name "kudo-sync-bot"
git config --global user.email "auto-sync@kudoai.com"
git add .
git commit -n -m "$(echo '${{ github.event.head_commit.message }}' | sed 's/`/\`/g') ↞ [auto-sync from \`KudoAI/chatgpt.js\`]" || true
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`KudoAI/chatgpt.js\`]" || true
git push
8 changes: 7 additions & 1 deletion .github/workflows/sync-en-readme-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ jobs:
# Store sync src for commit msg in next step
echo "sync_src=$sync_src" >> $GITHUB_OUTPUT
- name: Escape backticks in commit msg
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
echo "ESCAPED_MSG=$(echo "$COMMIT_MSG" | sed 's/`/\`/g')" >> $GITHUB_ENV
- name: Push changes to KudoAI/chatgpt.js
run: |
cd ${{ github.workspace }}/KudoAI/chatgpt.js
git config --global user.name "kudo-sync-bot"
git config --global user.email "auto-sync@kudoai.com"
git add .
git commit -n -m "$(echo '${{ github.event.head_commit.message }}' | sed 's/`/\`/g') ↞ [auto-sync from \`${{ steps.sync_readmes.outputs.sync_src }}\`]" || true
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`${{ steps.sync_readmes.outputs.sync_src }}\`]" || true
git push
8 changes: 7 additions & 1 deletion .github/workflows/sync-greasemonkey-starter-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ jobs:
"${{ github.workspace }}/KudoAI/chatgpt.js/starters/greasemonkey/" \
"${{ github.workspace }}/KudoAI/chatgpt.js-greasemonkey-starter/"
- name: Escape backticks in commit msg
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
echo "ESCAPED_MSG=$(echo "$COMMIT_MSG" | sed 's/`/\`/g')" >> $GITHUB_ENV
- name: Push changes to KudoAI/chatgpt.js-greasemonkey-starter
run: |
cd ${{ github.workspace }}/KudoAI/chatgpt.js-greasemonkey-starter
git config --global user.name "kudo-sync-bot"
git config --global user.email "auto-sync@kudoai.com"
git add .
git commit -n -m "$(echo '${{ github.event.head_commit.message }}' | sed 's/`/\`/g') ↞ [auto-sync from \`KudoAI/chatgpt.js\`]" || true
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`KudoAI/chatgpt.js\`]" || true
git push

0 comments on commit a282feb

Please sign in to comment.