Skip to content

WEBUI-2038: Fix remaining Dependabot vulnerabilities (round 2) [LTS-2023] #1578

WEBUI-2038: Fix remaining Dependabot vulnerabilities (round 2) [LTS-2023]

WEBUI-2038: Fix remaining Dependabot vulnerabilities (round 2) [LTS-2023] #1578

Workflow file for this run

name: Cleanup
on:
pull_request:
types: [closed, unlabeled]
branches:
- maintenance-3.1.x
workflow_dispatch:
inputs:
branch_name:
description: 'The name of the branch to preview.'
default: 'maintenance-3.1.x'
required: true
caller_id:
description: 'run identifier'
default: 'maintenance-3.1.x'
type: string
required: false
env:
GKE_CLUSTER: jx-prod
GKE_ZONE: us-east1-b
jobs:
id:
name: Remote Caller ID ${{ github.event.inputs.caller_id }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Show caller id
run: echo "run identifier ${{ github.event.inputs.caller_id }}"
cleanup:
needs: id
name: Preview
if: |
(github.event.action == 'unlabeled' && github.event.label.name == 'preview') ||
contains(github.event.pull_request.labels.*.name, 'preview') ||
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Prepare environment (pull_request)
if: github.event_name == 'pull_request'
run: |
BRANCH_NAME=${GITHUB_HEAD_REF##*/}
echo "PREVIEW_NAMESPACE=$(printf '%.53s' $(echo nuxeo-web-ui-$(echo $BRANCH_NAME | sed 's/[^[:alnum:]-]/-/g' | tr '[:upper:]' '[:lower:]')))" >> $GITHUB_ENV
- name: Prepare environment (workflow_dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
BRANCH_NAME=${{ github.event.inputs.branch_name }}
echo "PREVIEW_NAMESPACE=$(printf '%.53s' $(echo nuxeo-web-ui-$(echo $BRANCH_NAME | sed 's/[^[:alnum:]-]/-/g' | tr '[:upper:]' '[:lower:]')))" >> $GITHUB_ENV
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.GKE_SA_KEY }}
- name: Get GKE credentials
uses: google-github-actions/get-gke-credentials@v3.0.0
with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}
project_id: ${{ secrets.GKE_PROJECT }}
- name: Cleanup preview namespace
continue-on-error: true
run: |
kubectl delete ns ${PREVIEW_NAMESPACE}