Skip to content

Commit

Permalink
Update commands.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
romw314 authored Dec 8, 2023
1 parent 63e533c commit 39825d0
Showing 1 changed file with 11 additions and 29 deletions.
40 changes: 11 additions & 29 deletions .github/workflows/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,57 +66,39 @@ jobs:
- name: Make the change
id: change
run: |
err=0
echo 'logs<<EOF' >> "$GITHUB_OUTPUT"
{ node scripts/add-new-theme.cjs "$(jq <<< "$THEMEINFO" ".$PROP=$GOOD" 2>> "$GITHUB_OUTPUT" || err=1)" 2>&1 || err=1; } | tee -a "$GITHUB_OUTPUT"
[ err -ne 0 ] && exit "$err"
echo '==============================' | tee -a "$GITHUB_OUTPUT"
{ cat themes.new.json | { jq --tab . || err=1; } | tee src/themes.json; } 2>&1 | tee -a "$GITHUB_OUTPUT" || err=1
[ err -ne 0 ] && exit "$err"
echo >> "$GITHUB_OUTPUT" # ensure newline at the end
echo 'EOF' >> "$GITHUB_OUTPUT"
exit "$err"
node scripts/add-new-theme.cjs "$(jq <<< "$THEMEINFO" ".$PROP=$GOOD")"
echo '=============================='
cat themes.new.json | jq --tab . | tee src/themes.json
env:
THEMEINFO: ${{ steps.parse.outputs.parsed-issue }}
PROP: ${{ steps.extractcmd.outputs.prop }}
GOOD: ${{ steps.extractcmd.outputs.good }}
- name: Configure Git
id: gitconfig
run: |
echo 'logs<<EOF' >> "$GITHUB_OUTPUT"
( git config --global user.name "$GNAME" && git config --global user.email "$GEMAIL" ) 2>&1 | tee -a "$GITHUB_OUTPUT"
echo >> "$GITHUB_OUTPUT" # ensure newline at the end
echo 'EOF' >> "$GITHUB_OUTPUT"
git config --global user.name "$GNAME"
git config --global user.email "$GEMAIL"
env:
GNAME: ${{ github.actor }}
GEMAIL: ${{ github.actor }}@users.noreply.github.com
- name: Commit and push
id: commit
run: |
echo 'logs<<EOF' >> "$GITHUB_OUTPUT"
git add src/themes.json 2>&1 | tee -a "$GITHUB_OUTPUT"
git commit -m"Update $PROP to $GOOD" 2>&1 | tee -a "$GITHUB_OUTPUT"
git push 2>&1 | tee -a "$GITHUB_OUTPUT"
echo >> "$GITHUB_OUTPUT" # ensure newline at the end
echo 'EOF' >> "$GITHUB_OUTPUT"
git add src/themes.json
git commit -m"Update $PROP to $GOOD"
git push
env:
PROP: ${{ steps.extractcmd.outputs.prop }}
GOOD: ${{ steps.extractcmd.outputs.good }}
- name: Report error
if: ${{ failure() }}
run: |
if [ "$CHANGE" = failure ]; then
gh issue comment ${{ github.event.issue.number }} --body "❌ An error occured while doing the change:
\`\`\`$CHLOGS\`\`\`"
gh issue comment ${{ github.event.issue.number }} --body '❌ An error occured while doing the change:'
elif [ "$GITCONFIG" = failure ]; then
gh issue comment ${{ github.event.issue.number }} --body "❌ An internal error occured while configuring Git:
\`\`\`$GCLOGS\`\`\`"
gh issue comment ${{ github.event.issue.number }} --body '❌ An internal error occured while configuring Git:'
elif [ "$COMMIT" = failure ]; then
gh issue comment ${{ github.event.issue.number }} --body "❌ An internal error occured while commiting the changes:
\`\`\`$COMMIT_LOGS\`\`\`"
gh issue comment ${{ github.event.issue.number }} --body '❌ An internal error occured while commiting the changes:'
else
gh issue comment ${{ github.event.issue.number }} --body '❌ An internal error occured.'
fi
Expand Down

1 comment on commit 39825d0

@vercel
Copy link

@vercel vercel bot commented on 39825d0 Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

chess-no-25-docs – ./

chess-no-25-docs.vercel.app
chess-no-25-docs-git-master-romw314.vercel.app
chess-no-25-docs-romw314.vercel.app

Please sign in to comment.