Skip to content

Commit d44c248

Browse files
authored
Merge pull request #44555 from dotnet/main
Merge main into live
2 parents 67cb0f5 + c18bc63 commit d44c248

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

.github/workflows/live-protection.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ jobs:
88
live_protection_job:
99
name: Create comment
1010
runs-on: ubuntu-latest
11-
permissions:
12-
pull-requests: write
1311

1412
steps:
1513
- name: Harden Runner
@@ -19,14 +17,9 @@ jobs:
1917

2018
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
2119
env:
22-
SHOULD_COMMENT: ${{ github.base_ref == 'live' && github.head_ref != 'main' }}
20+
LIVE_BASE: ${{ github.base_ref == 'live' && github.head_ref != 'main' }}
2321
with:
2422
script: |
25-
if (process.env.SHOULD_COMMENT == 'true') {
26-
github.rest.issues.createComment({
27-
issue_number: context.issue.number,
28-
owner: context.repo.owner,
29-
repo: context.repo.repo,
30-
body: 'It looks like this pull request was opened on the live branch by mistake. In general, PRs should target main.'
31-
})
23+
if (process.env.LIVE_BASE == 'true') {
24+
core.setFailed('PR targets live branch')
3225
}

0 commit comments

Comments
 (0)