Skip to content

Commit

Permalink
Allow trusted people to run GitHub action tests (#94)
Browse files Browse the repository at this point in the history
* Allow trusted people to run tests

* Clarify when workflows run
  • Loading branch information
ristomcgehee authored Jan 25, 2024
1 parent f4e020f commit 4d2fe06
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/javascript-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ on:
types:
- opened
- labeled
- synchronize


jobs:
test:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'okay-to-test') || (github.event_name == 'push')
# We'll run if one of the following is met:
# 1. The 'okay-to-test' labeled has just been added to the PR.
# 2. A member or collaborator opens a PR or pushes new commits to it.
# 3. This is a push to the main branch.
if: |
(contains(github.event.pull_request.labels.*.name, 'okay-to-test') && github.event.action == 'labeled') ||
contains(fromJson('["MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) ||
github.event_name == 'push'
steps:
# https://github.com/actions/checkout/issues/518
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/python-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ on:
types:
- opened
- labeled
- synchronize

jobs:
test:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'okay-to-test') || (github.event_name == 'push')
# We'll run if one of the following is met:
# 1. The 'okay-to-test' labeled has just been added to the PR.
# 2. A member or collaborator opens a PR or pushes new commits to it.
# 3. This is a push to the main branch.
if: |
(contains(github.event.pull_request.labels.*.name, 'okay-to-test') && github.event.action == 'labeled') ||
contains(fromJson('["MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) ||
github.event_name == 'push'
steps:
# https://github.com/actions/checkout/issues/518
Expand Down

0 comments on commit 4d2fe06

Please sign in to comment.