feat: #1350 setup virus scan tool and update spatial endpoints #914
Workflow file for this run
This file contains hidden or 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: PR Closed | |
| on: | |
| pull_request: | |
| types: [closed] | |
| concurrency: | |
| # PR open and close use the same group, allowing only one at a time | |
| group: pr-${{ github.workflow }}-${{ github.event.number }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| cleanup_configmap: | |
| name: Cleanup FAM Route Allocations | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Remove FAM route allocations for PR | |
| uses: bcgov/action-oc-runner@v1.7.0 | |
| env: | |
| PR_NUMBER: ${{ github.event.number }} | |
| with: | |
| oc_namespace: ${{ vars.OC_NAMESPACE }} | |
| oc_server: ${{ vars.OC_SERVER }} | |
| oc_token: ${{ secrets.OC_TOKEN }} | |
| commands: | | |
| echo "Cleaning up route allocations for PR $PR_NUMBER" | |
| # Check if ConfigMap exists | |
| if ! oc get configmap fam-route-allocations &>/dev/null; then | |
| echo "ConfigMap fam-route-allocations does not exist, nothing to clean up" | |
| exit 0 | |
| fi | |
| # Get current ConfigMap data | |
| allocs=$(oc get configmap fam-route-allocations -o json | jq -r '.data // {}') | |
| # Build patch to remove entries for this PR | |
| patch='{"data": {' | |
| first=true | |
| for i in $(seq 0 49); do | |
| for prefix in hybrid postgres; do | |
| key="${prefix}_$i" | |
| pr=$(echo "$allocs" | jq -r ".$key // empty") | |
| if [[ "$pr" == "$PR_NUMBER" ]]; then | |
| if [ "$first" = false ]; then | |
| patch="$patch," | |
| fi | |
| patch="$patch\"$key\": null" | |
| first=false | |
| echo "Removing reservation: $key (PR $PR_NUMBER)" | |
| fi | |
| done | |
| done | |
| patch="$patch}}" | |
| if [ "$first" = false ]; then | |
| oc patch configmap fam-route-allocations --type merge -p "$patch" | |
| echo "Successfully removed route reservations for PR $PR_NUMBER" | |
| else | |
| echo "No route reservations found for PR $PR_NUMBER" | |
| fi | |
| cleanup: | |
| name: Cleanup and Images | |
| uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-close.yml@a11ad3d1b9288fb40757c4314a62eb86ff227931 # v1.2.1 | |
| permissions: | |
| packages: write | |
| secrets: | |
| oc_namespace: ${{ vars.OC_NAMESPACE }} | |
| oc_token: ${{ secrets.OC_TOKEN }} | |
| with: | |
| cleanup: label | |
| packages: backend backend-postgres frontend | |
| cleanup_name: ${{ github.event.repository.name }}-${{ github.event.number }}-hybrid ${{ github.event.repository.name }}-${{ github.event.number }}-postgres |