Skip to content

Commit f255580

Browse files
authored
Try to fix live protection (#44546)
1 parent f09daf0 commit f255580

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/live-protection.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ permissions:
44
contents: read
55

66
jobs:
7-
comment:
7+
live_protection_job:
8+
name: Prevent unintended merge to live
89
runs-on: ubuntu-latest
910
steps:
1011
- name: Harden Runner
@@ -14,14 +15,14 @@ jobs:
1415

1516
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
1617
env:
17-
SHOULD_COMMENT: ${{ github.base_ref == 'refs/heads/live' && !(github.event.issue.user.login == 'cxwtool' || github.head_ref == 'refs/heads/main') }}
18+
SHOULD_COMMENT: ${{ github.base_ref == 'live' && github.head_ref != 'main' }}
1819
with:
1920
script: |
2021
if (process.env.SHOULD_COMMENT == 'true') {
2122
github.issues.createComment({
2223
issue_number: context.issue.number,
2324
owner: context.repo.owner,
2425
repo: context.repo.repo,
25-
body: 'It looks like this pull request may have been opened on the `live` branch by mistake. In general, PRs should target the `main` branch.'
26+
body: 'It looks like this pull request was opened on the `live` branch by mistake. In general, PRs should target the `main` branch.'
2627
})
2728
}

0 commit comments

Comments
 (0)