Skip to content

Commit

Permalink
Adding pull_request_target workflow for secure PR validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bc3tech committed Jun 13, 2024
1 parent 861ae79 commit 8f81d98
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Build and Test

on:
pull_request:
workflow_run:
workflows: ["Publish Extension", "Receive PR"]
branches:
- main
workflow_dispatch:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/publish-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ jobs:
publish-gh-release:
needs: build-and-test
runs-on: ubuntu-latest
permissions: write-all
permissions:
contents: write

env:
EXTENSION_VERSION: ${{ needs.build-and-test.outputs.extVersion }}
GH_TOKEN: ${{ github.token }}
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/receive-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Receive PR

on:
pull_request_target:
branches:
- main
paths-ignore:
- '.github/**'

jobs:
build-and-test:
uses: ./.github/workflows/build-and-test.yml

0 comments on commit 8f81d98

Please sign in to comment.