From 1cbbc6eaa806b68e4b092e669655b5fb34a05725 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 10 Apr 2023 18:26:20 -0700 Subject: [PATCH 1/2] CI: Consolidate comment commandas GHA --- .../{preview-docs.yml => comment-commands.yml} | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) rename .github/workflows/{preview-docs.yml => comment-commands.yml} (58%) 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 From bbf5afc72d5dc38278273cecaa56d91117187944 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 10 Apr 2023 18:30:28 -0700 Subject: [PATCH 2/2] Remove unneeded workflow --- .github/workflows/assign.yml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 .github/workflows/assign.yml 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