Skip to content

Commit

Permalink
ci: remove PR target (#435)
Browse files Browse the repository at this point in the history
* ci: remove PR target

* ci: remove pr target
  • Loading branch information
matt-FFFFFF authored Jan 20, 2025
1 parent dee26d3 commit df4b4b4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/go-test-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Deployment test

on:
pull_request_target:
pull_request:
types: ['opened', 'reopened', 'synchronize', 'labeled']
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -36,7 +36,13 @@ jobs:
if: |
(
(
contains(github.event.pull_request.labels.*.name, 'PR: Safe to test :test_tube:')
(
contains(github.event.pull_request.labels.*.name, 'PR: Safe to test :test_tube:')
)
&&
(
github.event.pull_request.head.repo.full_name == 'Azure/terraform-azurerm-lz-vending'
)
)
||
(
Expand All @@ -55,25 +61,24 @@ jobs:
run: env | sort

- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: ${{ matrix.terraform_version }}
terraform_wrapper: false

- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: '1.20.x'
go-version-file: tests/go.mod
cache-dependency-path: tests/go.sum

- name: Azure login
uses: azure/login@v2
uses: azure/CLI@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # v2.1.0
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
Expand Down Expand Up @@ -108,7 +113,7 @@ jobs:

# This only works on Linux based runners
- name: Azure logout
uses: azure/CLI@v2
uses: azure/CLI@089eac9d8cc39f5d003e94f8b65efc51076c9cbd # v2.1.0
if: always()
with:
inlineScript: |
Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/go-test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Unit test

on:
pull_request_target:
pull_request:
types: ['opened', 'reopened', 'synchronize', 'labeled']
merge_group:
workflow_dispatch:
Expand Down Expand Up @@ -40,12 +40,6 @@ jobs:
github.event.pull_request.head.repo.full_name == 'Azure/terraform-azurerm-lz-vending'
)
||
(
github.event.pull_request.head.repo.full_name != 'Azure/terraform-azurerm-lz-vending'
&&
contains(github.event.pull_request.labels.*.name, 'PR: Safe to test :test_tube:')
)
||
(
github.event_name == 'workflow_dispatch'
)
Expand All @@ -56,24 +50,23 @@ jobs:
strategy:
fail-fast: false
matrix:
azapi_version: ['latest', '1.11.0']
azurerm_version: ['latest', '3.7.0']
terraform_version: ['latest', '1.4.0']
azapi_version: ['latest', '2.2.0']
azurerm_version: ['latest', '4.0.0']
terraform_version: ['latest', '1.8.0']
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: ${{ matrix.terraform_version }}
terraform_wrapper: false

- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: tests/go.mod
cache-dependency-path: tests/go.sum
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: "PR lint"

on:
pull_request_target:
pull_request:
types:
- opened
- edited
Expand Down

0 comments on commit df4b4b4

Please sign in to comment.