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 08bf889 commit cfd989b
Showing 1 changed file with 18 additions and 36 deletions.
54 changes: 18 additions & 36 deletions .github/workflows/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,42 +97,24 @@ jobs:
GOOD: ${{ steps.extractcmd.outputs.good }}
- name: Report error
if: ${{ failure() }}
uses: actions/github-script@v7.0.1
with:
script: |
switch (['change', 'gitconfig', 'commit'].map(step => context.steps[step].conclusion).indexOf('failure')) {
case 1: // change
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `:x: An error occured while doing the change:\n\n\`\`\`${context.env.CHANGE_LOGS}`
});
break;
case 2: // gitconfig
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `:x: An internal error occured while configuring Git:\n\n\`\`\`${context.env.GIT_CONFIG_LOGS}\`\`\``
});
break;
case 3: // commit
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `:x: An internal error occured while commiting the changes:\n\n\`\`\`${context.env.COMMIT_LOGS}\`\`\``
});
break;
default: // will usually be -1
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ':x: An internal error occured.'
});
}
run: |
if [ "$CHANGE" = failure ]; then
gh issue comment ${{ github.event.issue.number }} ":x: An error occured while doing the change:
\`\`\`$CHLOGS\`\`\`"
elif [ "$GITCONFIG" = failure ]; then
gh issue comment ${{ github.event.issue.number }} ":x: An internal error occured while configuring Git:
\`\`\`$GCLOGS\`\`\`"
elif [ "$COMMIT" = failure ]; then
gh issue comment ${{ github.event.issue.number }} ":x: An internal error occured while commiting the changes:
\`\`\`${context.env.COMMIT_LOGS}\`\`\`"
else
gh issue comment ${{ github.event.issue.number }} ':x: An internal error occured.'
fi
env:
GH_TOKEN: ${{ github.token }}
- name: Comment on PR
run: |
gh pr comment ${{ github.event.issue.number }} --body "🎉 Updated \`$PROP\` successfully 👏"
Expand Down

1 comment on commit cfd989b

@vercel
Copy link

@vercel vercel bot commented on cfd989b 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-romw314.vercel.app
chess-no-25-docs-git-master-romw314.vercel.app

Please sign in to comment.