Skip to content
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/build-lambda-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,36 @@ jobs:

# Output the full image URI for use in subsequent steps
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:latest" >> $GITHUB_OUTPUT

- name: "Trigger Terraform Cloud Run"
run: |
WORKSPACE_ID="${{ vars.TFC_WORKSPACE_ID_PWP_LAMBDA }}"

cat > payload.json <<EOF
{
"data": {
"attributes": {
"message": "Run triggered from PWP lambda update by commit ${{ github.sha }}"
},
"type": "runs",
"relationships": {
"workspace": {
"data": {
"type": "workspaces",
"id": "$WORKSPACE_ID"
}
}
}
}
}
EOF

curl --fail \
--header "Authorization: Bearer ${{ secrets.TFC_API_TOKEN }}" \
--header "Content-Type: application/vnd.api+json" \
--request POST \
--data @payload.json \
https://app.terraform.io/api/v2/runs
env:
TF_API_TOKEN: ${{ secrets.TFC_API_TOKEN }}
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable TF_API_TOKEN is defined but never used in the step. The Authorization header already uses ${{ secrets.TFC_API_TOKEN }} directly. This redundant environment variable should be removed.

Suggested change
TF_API_TOKEN: ${{ secrets.TFC_API_TOKEN }}

Copilot uses AI. Check for mistakes.
GITHUB_SHA: ${{ github.sha }}
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable GITHUB_SHA is defined but never used in the step. The commit SHA is already referenced directly as ${{ github.sha }} in the message on line 53. This redundant environment variable should be removed.

Suggested change
GITHUB_SHA: ${{ github.sha }}

Copilot uses AI. Check for mistakes.