Explorar o código

Improve stylua github workflow (#571)

Addressing issue nvim-lua/kickstart.nvim#570

This improves the github workflow to no longer require manual
approval for PRs from first time contributors.

Changes the github event from pull_request to pull_request_target
and adds an explicit PR head checkout
Damjan 9000 %!s(int64=2) %!d(string=hai) anos
pai
achega
c4055a2212
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      .github/workflows/stylua.yml

+ 3 - 1
.github/workflows/stylua.yml

@@ -1,6 +1,6 @@
 # Check Lua Formatting
 # Check Lua Formatting
 name: Check Lua Formatting
 name: Check Lua Formatting
-on: pull_request
+on: pull_request_target
 
 
 jobs:
 jobs:
   stylua-check:
   stylua-check:
@@ -9,6 +9,8 @@ jobs:
     steps:
     steps:
       - name: Checkout Code
       - name: Checkout Code
         uses: actions/checkout@v2
         uses: actions/checkout@v2
+        with:
+          ref: ${{ github.event.pull_request.head.sha }}
       - name: Stylua Check
       - name: Stylua Check
         uses: JohnnyMorganz/stylua-action@v3
         uses: JohnnyMorganz/stylua-action@v3
         with:
         with: