diff --git a/.github/workflows/assign.yml b/.github/workflows/assign.yml deleted file mode 100644 index b3331060823a9..0000000000000 --- a/.github/workflows/assign.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Assign -on: - issue_comment: - types: created - -permissions: - contents: read - -jobs: - issue_assign: - permissions: - issues: write - pull-requests: write - runs-on: ubuntu-22.04 - steps: - - if: github.event.comment.body == 'take' - run: | - echo "Assigning issue ${{ github.event.issue.number }} to ${{ github.event.comment.user.login }}" - 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 diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/comment-commands.yml similarity index 58% rename from .github/workflows/preview-docs.yml rename to .github/workflows/comment-commands.yml index 8f73db283289c..30dfd6acbeb7b 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/comment-commands.yml @@ -1,19 +1,25 @@ -name: Preview docs +name: Comment Commands on: issue_comment: types: created permissions: contents: read + issues: write + pull-requests: write jobs: + issue_assign: + runs-on: ubuntu-22.04 + steps: + - if: !github.event.issue.pull_request && github.event.comment.body == 'take' + run: | + echo "Assigning issue ${{ github.event.issue.number }} to ${{ github.event.comment.user.login }}" + 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 preview_docs: - permissions: - issues: write - pull-requests: write runs-on: ubuntu-22.04 steps: - - if: github.event.comment.body == '/preview' + - if: github.event.issue.pull_request && github.event.comment.body == '/preview' run: | if curl --output /dev/null --silent --head --fail "https://pandas.pydata.org/preview/${{ github.event.issue.number }}/"; then 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