Skip to content
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
12 changes: 12 additions & 0 deletions .github/workflows/lint-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Lint Workflows"

on:
pull_request:
branches: [main]
paths:
- '.github/workflows/*.yml'
- '.github/workflows/*.yaml'

jobs:
lint-workflows:
uses: alphagov/forms-deploy/.github/workflows/reusable-lint-workflows.yml@main
17 changes: 11 additions & 6 deletions .github/workflows/review_apps_on_pr_change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
- name: Determine Terraform version
id: terraform-version
run: |
cat .review_apps/.terraform-version | xargs printf "TF_VERSION=%s" >> "$GITHUB_OUTPUT"
TF_VERSION=$(< .review_apps/.terraform-version)
printf "TF_VERSION=%s\n" "$TF_VERSION" >> "$GITHUB_OUTPUT"

- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
Expand All @@ -63,10 +64,14 @@ jobs:
-var "forms_admin_container_image=${{env.CONTAINER_IMAGE_URI}}" \
-no-color \
-auto-approve

echo "REVIEW_APP_URL=$(terraform output -raw review_app_url)" >> "$GITHUB_OUTPUT"
echo "ECS_CLUSTER_ID=$(terraform output -raw review_app_ecs_cluster_id)" >> "$GITHUB_OUTPUT"
echo "ECS_SERVICE_NAME=$(terraform output -raw review_app_ecs_service_name)" >> "$GITHUB_OUTPUT"
REVIEW_APP_URL=$(terraform output -raw review_app_url)
ECS_CLUSTER_ID=$(terraform output -raw review_app_ecs_cluster_id)
ECS_SERVICE_NAME=$(terraform output -raw review_app_ecs_service_name)
{
printf 'REVIEW_APP_URL=%s\n' "$REVIEW_APP_URL"
printf 'ECS_CLUSTER_ID=%s\n' "$ECS_CLUSTER_ID"
printf 'ECS_SERVICE_NAME=%s\n' "$ECS_SERVICE_NAME"
} >> "$GITHUB_OUTPUT"

- name: Wait for AWS ECS deployments to finish
run: |
Expand All @@ -91,7 +96,7 @@ jobs:
$COMMENT_MARKER
EOF

old_comment_ids=$(gh api "repos/{owner}/{repo}/issues/${{github.event.pull_request.number}}/comments" --jq 'map(select((.user.login == "github-actions[bot]") and (.body | endswith($ENV.COMMENT_MARKER + "\n")))) | .[].id')
old_comment_ids=$(gh api "repos/{owner}/{repo}/issues/${{github.event.pull_request.number}}/comments" --jq "map(select((.user.login == \"github-actions[bot]\") and (.body | endswith(env.COMMENT_MARKER + \"\n\")))) | .[].id")
for comment_id in $old_comment_ids; do
gh api -X DELETE "repos/{owner}/{repo}/issues/comments/${comment_id}"
done
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/review_apps_on_pr_close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
- name: Determine Terraform version
id: terraform-version
run: |
cat .review_apps/.terraform-version | xargs printf "TF_VERSION=%s" >> "$GITHUB_OUTPUT"
TF_VERSION=$(< .review_apps/.terraform-version)
printf "TF_VERSION=%s\n" "$TF_VERSION" >> "$GITHUB_OUTPUT"

- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
- name: Determine Terraform version
id: terraform-version
run: |
cat .review_apps/.terraform-version | xargs printf "TF_VERSION=%s" >> "$GITHUB_OUTPUT"
TF_VERSION=$(< .review_apps/.terraform-version)
printf "TF_VERSION=%s\n" "$TF_VERSION" >> "$GITHUB_OUTPUT"

- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
Expand Down