From 7d23a076dec6fe52710ac7f1bd94376117273c2f Mon Sep 17 00:00:00 2001 From: Jonathan Prusik Date: Fri, 15 Aug 2025 13:17:38 -0400 Subject: [PATCH] [PM-24785] Skip/Exit early from "Autofill BIT checks" workflow if there is no associated pull request or branch (#16034) * check autofill bit checks workflow job requirements at the start of the job * add source branch name to executed workflow title --- .github/workflows/test-browser-interactions.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-browser-interactions.yml b/.github/workflows/test-browser-interactions.yml index 872b4c35264..3960bd04ef9 100644 --- a/.github/workflows/test-browser-interactions.yml +++ b/.github/workflows/test-browser-interactions.yml @@ -1,4 +1,5 @@ name: Autofill BIT checks +run-name: Autofill BIT checks on ${{ github.event.workflow_run.head_branch }} build on: workflow_run: @@ -11,10 +12,16 @@ jobs: name: Check files runs-on: ubuntu-22.04 permissions: - actions: read + actions: write contents: read id-token: write steps: + - name: Check for job requirements + if: ${{ !(github.event.workflow_run.pull_requests && github.event.workflow_run.pull_requests.length > 0 && github.event.workflow_run.head_branch) }} + run: | + gh run cancel ${{ github.run_id }} + gh run watch ${{ github.run_id }} + - name: Log in to Azure uses: bitwarden/gh-actions/azure-login@main with: