Skip to content

Commit 5ab10a3

Browse files
authored
CI: Consolidate comment commands GHA (#52587)
1 parent 7c55534 commit 5ab10a3

File tree

2 files changed

+11
-24
lines changed

2 files changed

+11
-24
lines changed

.github/workflows/assign.yml

-19
This file was deleted.

.github/workflows/preview-docs.yml renamed to .github/workflows/comment-commands.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
name: Preview docs
1+
name: Comment Commands
22
on:
33
issue_comment:
44
types: created
55

66
permissions:
77
contents: read
8+
issues: write
9+
pull-requests: write
810

911
jobs:
12+
issue_assign:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- if: !github.event.issue.pull_request && github.event.comment.body == 'take'
16+
run: |
17+
echo "Assigning issue ${{ github.event.issue.number }} to ${{ github.event.comment.user.login }}"
18+
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees
1019
preview_docs:
11-
permissions:
12-
issues: write
13-
pull-requests: write
1420
runs-on: ubuntu-22.04
1521
steps:
16-
- if: github.event.comment.body == '/preview'
22+
- if: github.event.issue.pull_request && github.event.comment.body == '/preview'
1723
run: |
1824
if curl --output /dev/null --silent --head --fail "https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"; then
1925
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"body": "Website preview of this PR available at: https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments

0 commit comments

Comments
 (0)