Skip to content

Commit

Permalink
ci: Run tft workflow on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrosi committed Aug 26, 2024
1 parent 6900853 commit 9bf57dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 53 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/tft.yml → .github/workflows/tft-pr.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
name: Run integration tests in Testing Farm
name: Run integration tests in Testing Farm on PR
on:
issue_comment:
pull_request:
types:
- created
- opened
- synchronize
- reopened
permissions:
contents: read
# This is required for the ability to create/update the Pull request status
Expand All @@ -16,13 +18,6 @@ jobs:
# group name contains reponame-pr_num to allow simualteneous runs in different PRs
group: testing-farm-${{ github.event.repository.name }}-${{ github.event.issue.number }}
cancel-in-progress: true
# Let's schedule tests only on user request. NOT automatically.
# Only repository owner or member can schedule tests
if: |
github.event.issue.pull_request
&& contains(github.event.comment.body, '[citest]')
&& (contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR", "CONTRIBUTOR"]'), github.event.comment.author_association)
|| contains('systemroller', github.event.comment.user.login))
runs-on: ubuntu-latest
outputs:
supported_platforms: ${{ steps.supported_platforms.outputs.supported_platforms }}
Expand All @@ -35,6 +30,23 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}

- name: Get User Permission
id: checkAccess
uses: actions-cool/check-user-permission@v2
with:
require: write
username: ${{ github.triggering_actor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check User Permission
if: steps.checkAccess.outputs.require-result == 'false'
run: |
echo "${{ github.triggering_actor }} does not have permissions on this repo."
echo "Job originally triggered by ${{ github.actor }} with permission level ${{ steps.checkAccess.outputs.user-permission }}"
echo "This jub can be re-run by a maintainer"
exit 1
- name: Checkout repo
uses: actions/checkout@v4

Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/tft_citest_bad.yml

This file was deleted.

0 comments on commit 9bf57dd

Please sign in to comment.