Destroying review app for PR "[dependabot:npm] Bump sass from 1.79.5 to 1.80.3 in the regular-updates group" #384
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: review-app-destroy | |
run-name: Destroying review app for PR "${{ github.event.pull_request.title }}" | |
on: | |
pull_request: | |
types: ["unlabeled", "closed", "converted_to_draft"] | |
workflow_dispatch: | |
workflow_call: | |
inputs: | |
pr_number: | |
required: true | |
type: string | |
env: | |
PR_NUMBER: ${{ inputs.pr_number || github.event.pull_request.number }} | |
CLUSTER: dev-eks-platform | |
jobs: | |
destroy: | |
name: Destroy Review Environment | |
runs-on: ubuntu-22.04 | |
permissions: | |
id-token: write | |
contents: read | |
issues: write | |
pull-requests: write | |
if: github.event.label.name == 'Review app' || inputs.pr_number | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: "arn:aws:iam::979633842206:role/EnergyComparisonTableDeployment" | |
role-session-name: energy-comparison-table-actions-workflow | |
aws-region: eu-west-1 | |
- name: Get Kube Config | |
run: aws eks update-kubeconfig --name=${{ env.CLUSTER }} | |
- name: Set Environment Variables | |
run: echo "NAMESPACE=review-${{ env.PR_NUMBER }}-energy-comparison-table" >> $GITHUB_ENV | |
- name: Destroy Review App | |
run: | | |
if [[ $(helm status -n ${{ env.NAMESPACE }} ${{ env.NAMESPACE }}) ]] ; then | |
kubectl delete subnamespaceanchor ${{ env.NAMESPACE }} -n dev-energy-comparison-table | |
fi | |
- name: Remove Review app label | |
if: contains(github.event.pull_request.labels.*.name, 'Review app') || inputs.pr_number | |
uses: actions-ecosystem/[email protected] | |
with: | |
labels: "Review app" | |
number: ${{ github.event.issue.number || github.event.pull_request.number || inputs.pr_number }} | |
- name: Find Comment | |
uses: peter-evans/find-comment@v3 | |
id: find-comment | |
with: | |
issue-number: ${{ env.PR_NUMBER }} | |
comment-author: "github-actions[bot]" | |
body-includes: A review app has been created in the Kubernetes namespace | |
direction: last | |
- name: Update Comment | |
uses: peter-evans/create-or-update-comment@v4 | |
if: steps.find-comment.outputs.comment-id | |
with: | |
issue-number: ${{ env.PR_NUMBER }} | |
edit-mode: replace | |
comment-id: ${{ steps.find-comment.outputs.comment-id }} | |
body: | | |
A review app has been created in the Kubernetes namespace `${{ env.NAMESPACE }}` in the `${{ env.CLUSTER }}` cluster. | |
Please see the [FAQ](https://citizensadvice.atlassian.net/wiki/spaces/OPS/pages/3769204741/Casebook+Review+Apps+FAQ) for more information. | |
--- | |
Edit: The review environment and namespace has been destroyed and the label `Review app` has been removed from the PR. Re-apply the `Review app` label to recreate it. |