diff --git a/.github/workflows/remove-safe-to-test-label.yml b/.github/workflows/remove-safe-to-test-label.yml new file mode 100644 index 0000000000..22103723dc --- /dev/null +++ b/.github/workflows/remove-safe-to-test-label.yml @@ -0,0 +1,21 @@ +name: Remove safe-to-test label on new commits + +on: + pull_request_target: + branches: + - main + - v8 + types: + - synchronize + +jobs: + remove-label: + runs-on: ubuntu-latest + permissions: + pull-requests: write + if: contains(github.event.pull_request.labels.*.name, 'safe-to-test') + steps: + - name: Remove safe-to-test label + run: gh pr edit "${{ github.event.pull_request.number }}" --remove-label "safe-to-test" + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index 3a646851d2..f874f6ed34 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -25,6 +25,11 @@ on: branches: - main - v8 + types: + - opened + - synchronize + - reopened + - labeled paths-ignore: - "doc/**" - ".gitpod.yml" @@ -33,7 +38,13 @@ on: jobs: get-sha: runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' }} + if: | + ${{ github.actor != 'dependabot[bot]' && ( + github.event.pull_request.author_association == 'OWNER' || + github.event.pull_request.author_association == 'COLLABORATOR' || + (github.event_name == 'labeled' && + github.event.label.name == 'safe-to-test') + ) }} outputs: gitRef: ${{steps.calculate.outputs.ref}} steps: