From 1acf3232b28ed497b1e9e3fff2d5ed8c365e183a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Tue, 16 Sep 2025 15:28:06 +0200 Subject: [PATCH] Comment workflow --- .github/workflows/comment_bot.yml | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/comment_bot.yml b/.github/workflows/comment_bot.yml index 85157760d66..b120ee7c1aa 100644 --- a/.github/workflows/comment_bot.yml +++ b/.github/workflows/comment_bot.yml @@ -56,6 +56,44 @@ jobs: --event-name ${{ github.event_name }} \ --event-payload ${{ github.event_path }} + ci: + name: Listen CI! + if: startsWith(github.event.comment.body, '@github-actions ci') && ${{ github.event.issue.pull_request }} + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Checkout Arrow + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + path: arrow + # fetch the tags for version number generation + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + with: + python-version: 3.12 + - name: Parse comment + id: parse_comment + uses: actions/github-script@v7 + with: + script: | + let body = github.event.comment.body.trim(); + // Match format: @github-actions ci -w workflow_name regex + const match = body.match(/^@github-actions ci\s+-w\s+(\S+)\s+(.+)$/); + if (!match) { + core.setFailed('Comment format invalid. Expected: @github-actions ci -w workflow_name regex'); + } else { + const workflow = match[1]; + const regex = match[2]; + core.setOutput('workflow', workflow); + core.setOutput('regex', regex); + } + - name: Handle GitHub comment event + run: | + echo ${{ steps.parse_comment.outputs.workflow }} + echo ${{ steps.parse_comment.outputs.regex }} + issue_assign: name: "Assign issue" permissions: