Skip to content

Commit

Permalink
Replaced sync step output w/ env var for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Oct 15, 2024
1 parent 972f232 commit 1f30a7c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/sync-en-readme-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@ jobs:
fetch-depth: 2

- name: Sync English READMEs between root + docs/
id: sync_readmes
run: |
cd "${{ github.workspace }}/KudoAI/chatgpt.js"
root_readme_modified=$(git log -1 --format="%ct" -- "README.md")
docs_readme_modified=$(git log -1 --format="%ct" -- "docs/README.md")
if [ "$root_readme_modified" -gt "$docs_readme_modified" ] ; then cp -f "README.md" "docs/README.md" ; sync_src="root"
elif [ "$docs_readme_modified" -gt "$root_readme_modified" ] ; then cp -f "docs/README.md" "README.md" ; sync_src="docs" ; fi
# Store sync src for commit msg in next step
echo "sync_src=$sync_src" >> $GITHUB_OUTPUT
# Expose sync src for commit msg in push step
echo "sync_src=$sync_src" >> $GITHUB_ENV
- name: Escape backticks in commit msg
env:
Expand All @@ -55,5 +54,5 @@ jobs:
run: |
cd ${{ github.workspace }}/KudoAI/chatgpt.js
git add .
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`${{ steps.sync_readmes.outputs.sync_src }}\`]" || true
git commit -n -m "$ESCAPED_MSG ↞ [auto-sync from \`${{ env.sync_src }}\`]" || true
git push

0 comments on commit 1f30a7c

Please sign in to comment.