Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/comment_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,58 @@ 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:
actions: 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 = context.payload.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 }}
- name: Run workflow
id: run_workflow
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pr_branch=$(gh pr view ${{ github.event.issue.number }} \
--jq '.headRefName' \
--json headRefName \
--repo ${GITHUB_REPOSITORY})
echo "pr_branch=${pr_branch}"
cd arrow
gh workflow run ${{ steps.parse_comment.outputs.workflow }}.yml \
--ref ${pr_branch} \
-f regex=${{ steps.parse_comment.outputs.regex }}

issue_assign:
name: "Assign issue"
permissions:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/cpp_extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ on:
- opened
- reopened
- synchronize
workflow_dispatch:
inputs:
regex:
description: "Regex pattern to run specific jobs"
type: string
required: true
schedule:
- cron: |
0 0 * * *
Expand Down Expand Up @@ -113,6 +119,9 @@ jobs:
fi
fi
;;
workflow_dispatch)
ci_extra=true
;;
esac

echo "ci-extra=${ci_extra}" >> "${GITHUB_OUTPUT}"
Expand Down
1 change: 1 addition & 0 deletions dev/archery/archery/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ def integration(with_all=False, random_seed=12345, **args):
@click.option('--event-payload', '-p', type=click.File('r', encoding='utf8'),
default='-', required=True)
def trigger_bot(arrow_token, committers_file, event_name, event_payload):
print("Test")
from .bot import CommentBot, PullRequestWorkflowBot, actions
from ruamel.yaml import YAML

Expand Down
Loading