File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed
Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -3,36 +3,43 @@ name: Test pull_request_target event
33on :
44 - pull_request_target # zizmor: ignore[dangerous-triggers]
55
6- permissions :
7- contents : read
6+ permissions : {}
87
98jobs :
109 apply :
1110 runs-on : ubuntu-24.04
1211 name : Apply approved changes on pull_request_target
12+ if : github.repository == 'dflook/terraform-github-actions' && github.event.pull_request.head.repo.full_name == github.repository
1313 permissions :
14- contents : read
1514 pull-requests : write
1615 env :
1716 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1817 steps :
19- - name : Checkout
20- uses : actions/checkout@v4
21- with :
22- persist-credentials : false
18+ - name : Create test module
19+ run : |
20+ mkdir -p test-module
21+ cat > test-module/main.tf << 'EOF'
22+ resource "random_string" "my_string" {
23+ length = 11
24+ }
25+
26+ output "output_string" {
27+ value = "the_string"
28+ }
29+ EOF
2330
2431 - name : Plan
25- uses : . /terraform-plan
32+ uses : dflook /terraform-plan@v1
2633 with :
2734 label : pull_request_target
28- path : tests/workflows/pull_request_target
35+ path : test-module
2936
3037 - name : Apply
31- uses : . /terraform-apply
38+ uses : dflook /terraform-apply@v1
3239 id : output
3340 with :
3441 label : pull_request_target
35- path : tests/workflows/pull_request_target
42+ path : test-module
3643
3744 - name : Verify outputs
3845 env :
You can’t perform that action at this time.
0 commit comments