Skip to content

delete_catalog

delete_catalog #187

name: Delete Cloud Native Catalog Items
on:
repository_dispatch:
types: [delete_catalog]
jobs:
UpdateCloudNativeCatalog:
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Set env
run : |
echo "MESHERY_CLOUD_BASE_URL=https://meshery.layer5.io" >> $GITHUB_ENV
echo "MESHERY_CATALOG_FILES_DIR=catalog" >> $GITHUB_ENV
- name: Delete Catalog Patterns
run: |
patternType="${{ github.event.client_payload.type }}"
if [[ $patternType == "" ]]; then
patternType="Deployment"
fi
filename="${{ github.event.client_payload.pattern_id }}"
if [[ $filename != "" ]]; then
rm -f $MESHERY_CATALOG_FILES_DIR/$filename.yaml
rm -f ./collections/_catalog/"$(echo $patternType | tr '[:upper:]' '[:lower:]')"/$filename.md
else
echo "No patterns to delete"
fi
- name: Delete Catalog Filters
run: |
filterType="${{ github.event.client_payload.type }}"
if [[ $filterType == "" ]]; then
filterType="wasm filter"
fi
filename="${{ github.event.client_payload.filter_id }}"
if [[ $filename != "" ]]; then
rm -f $MESHERY_CATALOG_FILES_DIR/$filename.yaml
rm -f ./collections/_catalog/"$(echo $filterType | tr '[:upper:]' '[:lower:]')"/$filename.md
else
echo "No Filters to delete"
fi
- name: Pull changes from remote
run: git pull origin master
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: catalog/* collections/_catalog/*
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: '--signoff'
commit_message: '[Catalog] Update Catalog items'