Skip to content

Commit de1244a

Browse files
committed
ping
1 parent 4daa90f commit de1244a

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.github/workflows/commentator.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,32 @@ permissions:
2222
issues: write
2323

2424
jobs:
25+
ping:
26+
runs-on: ubuntu-latest
27+
if: |
28+
(
29+
(github.event_name == 'issue_comment' && github.event.issue.pull_request != null) ||
30+
(github.event_name == 'pull_request_review_comment')
31+
) &&
32+
(github.event.comment.body == 'ping' || startsWith(github.event.comment.body, 'ping ')) &&
33+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.author_association)
34+
steps:
35+
- run: |
36+
API="https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/comments"
37+
COMMENT="pong"
38+
BY_MAINTAINER=${{ contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.author_association) && 'true' || 'false' }}
39+
if [ "$BY_MAINTAINER" = "true" ]; then
40+
COMMENT="${COMMENT}\n\nYou are either owner, member, or collaborator"
41+
else
42+
COMMENT="${COMMENT}\n\nYou are not an owner, member, or collaborator."
43+
fi
44+
curl -sS -o /dev/null -L -X POST "$API" \
45+
-H "Accept: application/vnd.github+json" \
46+
-H "Authorization: Bearer ${{ github.token }}" \
47+
-H "X-GitHub-Api-Version: 2022-11-28" \
48+
-H "Content-Type: application/json" \
49+
-d "{\"body\":\"${COMMENT}\"}"
50+
2551
fmt:
2652
name: "Formatting changes"
2753
runs-on: ubuntu-latest

.github/workflows/linter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
format-check:
2323
name: "Formatting"
2424
runs-on: ubuntu-latest
25+
if: false # TODO: enable it back
2526
steps:
2627
- name: Checkout repository
2728
uses: actions/checkout@v4

0 commit comments

Comments
 (0)