Skip to content

feat: undeploy endpoints #11

feat: undeploy endpoints

feat: undeploy endpoints #11

name: Verify Quartz migrations
on:
push:
branches: [ main ]
paths:
- 'backend/packagegroups/NuGet.props'
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened]
paths:
- 'backend/**'
workflow_dispatch:
jobs:
check-quartz-update:
name: Check Quartz update
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: output base branch
id: output-base-branch
run: echo "base-branch=${{ github.head_ref }}"
- name: Check if quartz library is updated
id: check-quartz-update
run: |
git fetch origin ${{ github.base_ref }} && git checkout ${{ github.base_ref }}
git fetch origin ${{ github.head_ref }} && git checkout ${{ github.head_ref }}
base_branch=${{ github.base_ref }} # Get the base branch
pr_branch=${{ github.head_ref }} # Get the PR branch
diff=$(git diff --unified=0 $base_branch...$pr_branch -- backend/packagegroups/NuGet.props | grep + | grep Quartz | grep Version)
if [ -n "$diff" ]; then
echo "is-updated=true" >> $GITHUB_OUTPUT
else
echo "is-updated=false" >> $GITHUB_OUTPUT
fi
- name: Notify if quartz library is updated
id: get-quartz-version
if: steps.check-quartz-update.outputs.is-updated == 'true'
run: |
version=$(git diff --unified=0 backend/packagegroups/NuGet.props | grep Quartz | grep Version | grep + | sed -n 's/.*Version="\([^"]*\)".*/\1/p')
echo "quartz-version=$version" >> $GITHUB_OUTPUT
- name: Verify tables sql is not updated
id: check-tables-update
if: steps.check-quartz-update.outputs.is-updated == 'true'
run: |
download_url=$(curl https://api.github.com/repos/quartznet/quartznet/releases/tags/v${{ steps.get-quartz-version.outputs.quartz-version }} | \
jq -r '.assets[] | select(.name | contains("Quartz.NET-${{ steps.get-quartz-version.outputs.quartz-version }}.zip")) | .browser_download_url')
mkdir qdwn
curl -L -o qdwn/quartz.zip $download_url && unzip qdwn/quartz.zip && rm qdwn/quartz.zip
diff=$(diff -u backend/src/Designer/Migrations/Quartz/tables_postgres.sql qdwn/database/tables/tables_postgres.sql)
if [ -n "$diff" ]; then
exit 1;
else
echo "Tables file is up to date"
fi