Skip to content

Commit 1f6eb18

Browse files
committed
run on PRs
1 parent 1545e20 commit 1f6eb18

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/update-azure-coverage.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
required: true
1010
type: string
1111
description: "Branch to checkout and compare against (e.g. harshmishra/doc-91)"
12+
pull_request:
13+
types: [opened, synchronize, reopened]
1214

1315
jobs:
1416
update-azure-coverage:
@@ -23,7 +25,7 @@ jobs:
2325
with:
2426
fetch-depth: 0
2527
path: docs
26-
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.targetBranch || 'main' }}
28+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.targetBranch || github.event_name == 'pull_request' && github.head_ref || 'main' }}
2729

2830
- name: Set up system wide dependencies
2931
run: |
@@ -58,7 +60,7 @@ jobs:
5860
id: check-for-changes
5961
working-directory: docs
6062
env:
61-
TARGET_BRANCH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.targetBranch || 'main' }}
63+
TARGET_BRANCH: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.targetBranch || github.event_name == 'pull_request' && github.head_ref || 'main' }}
6264
run: |
6365
mkdir -p resources
6466
(git diff --name-only origin/automated-azure-coverage-updates src/data/azure-coverage/ 2>/dev/null || git diff --name-only "origin/$TARGET_BRANCH" src/data/azure-coverage/ 2>/dev/null) | tee -a resources/diff-check.log
@@ -67,7 +69,7 @@ jobs:
6769
6870
- name: Create PR
6971
uses: peter-evans/create-pull-request@v7
70-
if: ${{ success() && steps.check-for-changes.outputs.diff-count != '0' && steps.check-for-changes.outputs.diff-count != '' }}
72+
if: ${{ github.event_name != 'pull_request' && success() && steps.check-for-changes.outputs.diff-count != '0' && steps.check-for-changes.outputs.diff-count != '' }}
7173
with:
7274
path: docs
7375
title: "Update Azure coverage data"

0 commit comments

Comments
 (0)