Skip to content

Commit 6e160c1

Browse files
authored
Update name (#10882)
1 parent 7bdf6ad commit 6e160c1

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

.github/workflows/live-protection.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1+
name: Base branch checker
12
on: [pull_request]
23

34
permissions:
45
contents: read
56

67
jobs:
7-
comment:
8+
live_protection_job:
9+
name: Check base branch
810
runs-on: ubuntu-latest
11+
912
steps:
1013
- name: Harden Runner
11-
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
14+
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
1215
with:
1316
egress-policy: audit
1417

1518
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
1619
env:
17-
SHOULD_COMMENT: ${{ github.base_ref == 'refs/heads/live' && !(github.head_ref == 'refs/heads/main') }}
20+
LIVE_BASE: ${{ github.base_ref == 'live' && github.head_ref != 'main' }}
1821
with:
1922
script: |
20-
if (process.env.SHOULD_COMMENT == 'true') {
21-
github.issues.createComment({
22-
issue_number: context.issue.number,
23-
owner: context.repo.owner,
24-
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-
})
23+
if (process.env.LIVE_BASE == 'true') {
24+
core.setFailed('PR targets live branch')
2725
}

0 commit comments

Comments
 (0)