File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ on : [pull_request]
2
+
3
+ permissions :
4
+ contents : read
5
+
6
+ jobs :
7
+ comment :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - name : Harden Runner
11
+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
12
+ with :
13
+ egress-policy : audit
14
+
15
+ - uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
16
+ env :
17
+ SHOULD_COMMENT : ${{ github.base_ref == 'refs/heads/live' && !(github.head_ref == 'refs/heads/main') }}
18
+ with :
19
+ 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
+ })
27
+ }
You can’t perform that action at this time.
0 commit comments