From ca4d3620064f556b207b9f67e00198aa33ac4ef4 Mon Sep 17 00:00:00 2001 From: Priyansh Garg Date: Tue, 13 Jul 2021 22:21:33 +0530 Subject: [PATCH] zulibot-action: Add commands-action. --- .github/workflows/commands-action.yml | 18 +++++++++++ .github/zulipbot-config/commands-action.yml | 35 +++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/commands-action.yml create mode 100644 .github/zulipbot-config/commands-action.yml diff --git a/.github/workflows/commands-action.yml b/.github/workflows/commands-action.yml new file mode 100644 index 000000000..5d65f37e4 --- /dev/null +++ b/.github/workflows/commands-action.yml @@ -0,0 +1,18 @@ +name: Commands Action + +on: + # Run the action whenever a comment is added on an issue or PR. + # (`issue_comment` event is triggered on PR comments as well.) + issue_comment: + types: created + +jobs: + commands-action: + runs-on: ubuntu-latest + steps: + - name: Handle commands + uses: garg3133/zulipbot-action/commands-action@main + with: + token: ${{ secrets.BOT_ACCESS_TOKEN }} + # Relative path to the commands-action config file. + config-file-path: .github/zulipbot-config/commands-action.yml diff --git a/.github/zulipbot-config/commands-action.yml b/.github/zulipbot-config/commands-action.yml new file mode 100644 index 000000000..88fd65a51 --- /dev/null +++ b/.github/zulipbot-config/commands-action.yml @@ -0,0 +1,35 @@ +# Enable @claim and @abandon issue commands. +assign: + # Maximum users who can claim a single issue. + max_assignees: 1 + + # Whether or not to invite the contributors claiming an issue + # for the first time on your repository, as a collaborator + # with the "pull" (read) permission on you repository, before + # assigning them the issue. + add_as_collaborator: true + + # Restrictions on the new contributors. + new_contributors: + # Maximum issues a new contributor can claim at the same + # time. + max_issue_claims: 1 + + # Allow the new contributors to claim an issue only if it + # contains/does no contain certain labels. + assign_only_if: + any_label_present: ["good first issue", "help wanted"] + +# Enable @add and @remove label commands. +label: + # @keywords: + # "all": All authenticated users on GitHub. + # "author": Author of issue or pull request. + # "member": Member of the organization containing the + # repository. + # "@username": Specific GitHub user. + + # Users given full_permission can add or remove any labels on + # issues and pull requests. + full_permission: + to: ["author"]