Skip to content

Commit

Permalink
Add Github Action to add a commit with #run-e2e-tests (facebook#41311)
Browse files Browse the repository at this point in the history
Summary:
facebook#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: facebook#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
  • Loading branch information
cipolleschi authored and Othinn committed Jan 9, 2024
1 parent 8cc63e6 commit f2f5d4e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/run_e2e_tests.yml
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit f2f5d4e

Please sign in to comment.