Skip to content

test: testing ip forward feature INTER-614 #44

test: testing ip forward feature INTER-614

test: testing ip forward feature INTER-614 #44

Workflow file for this run

name: CI Cleanup
on:
pull_request:
types:
- closed
jobs:
cleanup:
if: github.event.pull_request.merged == true
runs-on: ubuntu-20.04
steps:
- name: Extract Branch Name
id: extract-branch
run: |
echo SUBDOMAIN=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | perl -pe 's/[^a-zA-Z0-9]+/-/g and s/-+$//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
- name: Check If DNS Record Exists
id: cloudflare-dns-check
uses: fjogeleit/http-request-action@v1
with:
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records?name=${{steps.extract-branch.outputs.SUBDOMAIN}}.${{secrets.FPJS_CI_DOMAIN}}&tags=owner:akamai-integration-ci'
method: 'GET'
customHeaders: '{"Authorization": "Bearer ${{ secrets.CF_AUTH_TOKEN }}"}'
- name: Delete Cloudflare DNS Record
if: ${{ fromJson(steps.cloudflare-dns-check.outputs.response).result_info.total_count > 0 }}
uses: fjogeleit/http-request-action@v1
with:
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records/${{ fromJson(steps.cloudflare-dns-check.outputs.response).result[0].id }}'
method: 'DELETE'
customHeaders: '{"Authorization": "Bearer ${{ secrets.CF_AUTH_TOKEN }}"}'