From 6cca6fb3b8de6ab5e70776b275ea91c50d5fd18a Mon Sep 17 00:00:00 2001 From: Risto McGehee Date: Mon, 15 Jan 2024 18:20:02 -0800 Subject: [PATCH] Allow trusted people to run tests --- .github/workflows/javascript-tests.yaml | 6 +++++- .github/workflows/python-tests.yaml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/javascript-tests.yaml b/.github/workflows/javascript-tests.yaml index 17e3272..c263030 100644 --- a/.github/workflows/javascript-tests.yaml +++ b/.github/workflows/javascript-tests.yaml @@ -9,12 +9,16 @@ 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') + 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 diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index 33b7c74..d198889 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -9,11 +9,15 @@ 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') + 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