Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make diff jobs work with pull_request_target #263

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/diff-cdktf-stacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ on:
required: true
description: JSON-stringified list of stacks to deploy, e.g. # [{ "stack": "my-stack" }]
type: string
ref:
required: true
description: The SHA ref of the commit to check out
type: string
repository:
required: true
description: The fully qualified name of the repository to check out the commit from
type: string

jobs:
terraform:
Expand All @@ -20,6 +28,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ inputs.ref }}
repository: ${{ inputs.repository }}

- name: Setup Terraform
uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ jobs:
needs: build-shard-matrix
with:
stacks: ${{ needs.build-shard-matrix.outputs.matrix }}
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
secrets: inherit

diff_constructs:
uses: ./.github/workflows/diff-cdktf-stacks.yml
with:
stacks: '{"stack":["custom-constructs"]}'
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
secrets: inherit