From 19945ad83b12c03d8b0931fd1a02bebabbc1a96b Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 9 Nov 2023 05:53:47 -0800 Subject: [PATCH] Add Github Action to add a commit with #run-e2e-tests (#41311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: https://github.com/facebook/react-native/issues/41308 introduce the possibility to run e2e tests if a commit contains #run-e2e-tests in the commit message. This PR builds on top of that, and let users to run e2e tests by adding a comment with with #run-e2e-tests ## Changelog: [Internal] - Allow to run e2e tests from comments Pull Request resolved: https://github.com/facebook/react-native/pull/41311 Test Plan: Not sure it can be tested until the PR is merged... ¯\_(ツ)_/¯ Reviewed By: dmytrorykun Differential Revision: D51111543 Pulled By: cipolleschi fbshipit-source-id: e6c55950552f03830fa35c89d385ab9b17f8facb --- .github/workflows/run_e2e_tests.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/run_e2e_tests.yml diff --git a/.github/workflows/run_e2e_tests.yml b/.github/workflows/run_e2e_tests.yml new file mode 100644 index 00000000000000..7bb84bad32103e --- /dev/null +++ b/.github/workflows/run_e2e_tests.yml @@ -0,0 +1,26 @@ +name: Run E2E Tests +# This workflow is used to trigger E2E tests on a PR when a comment is made +# containing the text "#run-e2e-tests". +on: + issue_comment: + types: [created] +permissions: + contents: read +jobs: + rebase: + name: Trigger E2E Tests + permissions: + contents: write # for cirrus-actions/rebase to push code to rebase + pull-requests: read # for cirrus-actions/rebase to get info about PR + runs-on: ubuntu-latest + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '#run-e2e-tests') + steps: + - name: Checkout the latest code + uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + - name: Push empty commit + run: | + git commit -m "#run-e2e-tests" --allow-empty + git push origin $(git branch --show-current)