ci: fix bot help command responses
This commit is contained in:
@@ -18,11 +18,29 @@ jobs:
|
|||||||
app-id: ${{ secrets.OC_REVIEW_APP_ID }}
|
app-id: ${{ secrets.OC_REVIEW_APP_ID }}
|
||||||
private-key: ${{ secrets.OC_REVIEW_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.OC_REVIEW_APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Acknowledge help command
|
||||||
|
id: reaction
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
COMMENT_ID: ${{ github.event.comment.id }}
|
||||||
|
run: |
|
||||||
|
reaction_id="$(gh api \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
"repos/${GITHUB_REPOSITORY}/issues/comments/${COMMENT_ID}/reactions" \
|
||||||
|
-f content='eyes' \
|
||||||
|
--jq '.id')"
|
||||||
|
|
||||||
|
echo "reaction_id=$reaction_id" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Post help
|
- name: Post help
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
GH_REPO: ${{ github.repository }}
|
||||||
COMMENT_BODY: ${{ github.event.comment.body }}
|
COMMENT_BODY: ${{ github.event.comment.body }}
|
||||||
|
COMMENT_ID: ${{ github.event.comment.id }}
|
||||||
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
|
EYES_REACTION_ID: ${{ steps.reaction.outputs.reaction_id }}
|
||||||
run: |
|
run: |
|
||||||
first_line="${COMMENT_BODY%%$'\n'*}"
|
first_line="${COMMENT_BODY%%$'\n'*}"
|
||||||
|
|
||||||
@@ -51,3 +69,17 @@ jobs:
|
|||||||
- <code>@openchamber-bot summarize focus on unresolved blockers</code>
|
- <code>@openchamber-bot summarize focus on unresolved blockers</code>
|
||||||
- <code>@openchamber-bot triage this looks like a Windows desktop regression</code>
|
- <code>@openchamber-bot triage this looks like a Windows desktop regression</code>
|
||||||
- <code>@openchamber-bot reproduce try the steps from the latest reporter comment</code>"
|
- <code>@openchamber-bot reproduce try the steps from the latest reporter comment</code>"
|
||||||
|
|
||||||
|
if [ -n "$EYES_REACTION_ID" ]; then
|
||||||
|
gh api \
|
||||||
|
--method DELETE \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
"repos/${GITHUB_REPOSITORY}/issues/comments/${COMMENT_ID}/reactions/${EYES_REACTION_ID}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
gh api \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
|
"repos/${GITHUB_REPOSITORY}/issues/comments/${COMMENT_ID}/reactions" \
|
||||||
|
-f content='+1' >/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user