Skip to content

Commit b84f0b7

Browse files
committed
Fix CI checkout after github new security policy
Github now fails with the following error when using `on: pull_request_target`: ``` Error: Refusing to check out fork pull request code from a 'pull_request_target' workflow. This workflow runs with the base repository's GITHUB_TOKEN, secrets, default-branch cache scope, and runner access. Fetching and executing a fork's code in that trusted context commonly leads to "pwn request" vulnerabilities. To opt in, review the risks at https://gh.io/securely-using-pull_request_target and set 'allow-unsafe-pr-checkout: true' on the actions/checkout step. ``` This reverts #571 and reopens #570
1 parent bd53f28 commit b84f0b7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/stylua.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Check Lua Formatting
22
name: Check Lua Formatting
3-
on: pull_request_target
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
48

59
jobs:
610
stylua-check:
@@ -10,8 +14,6 @@ jobs:
1014
steps:
1115
- name: Checkout Code
1216
uses: actions/checkout@v6
13-
with:
14-
ref: ${{ github.event.pull_request.head.sha }}
1517
- name: Stylua Check
1618
uses: JohnnyMorganz/stylua-action@v4
1719
with:

0 commit comments

Comments
 (0)