From 0cbceff2092aa392fdcc9cfadd4eae203a155e65 Mon Sep 17 00:00:00 2001 From: Eddy Filip Date: Thu, 20 Feb 2025 13:39:37 +0100 Subject: [PATCH] Add ok-to-test command This command will trigger an end-to-end workflow with the external contributor's code. --- .github/workflows/ok-to-test.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/ok-to-test.yml diff --git a/.github/workflows/ok-to-test.yml b/.github/workflows/ok-to-test.yml new file mode 100644 index 0000000..e1d4060 --- /dev/null +++ b/.github/workflows/ok-to-test.yml @@ -0,0 +1,25 @@ +# If someone with write access comments "/ok-to-test" on a pull request, emit a repository_dispatch event +name: Ok To Test + +on: + issue_comment: + types: [created] + +jobs: + ok-to-test: + runs-on: ubuntu-latest + permissions: + pull-requests: write # For adding reactions to the pull request comments + contents: write # For executing the repository_dispatch event + # Only run for PRs, not issue comments + if: ${{ github.event.issue.pull_request }} + steps: + - name: Slash Command Dispatch + uses: peter-evans/slash-command-dispatch@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + reaction-token: ${{ secrets.GITHUB_TOKEN }} + issue-type: pull-request + commands: ok-to-test + # The repository permission level required by the user to dispatch commands. Only allows 1Password collaborators to run this. + permission: write