Skip to content

chore(ams1): update PIVIPI-AMS peering to dynamic #53

chore(ams1): update PIVIPI-AMS peering to dynamic

chore(ams1): update PIVIPI-AMS peering to dynamic #53

Workflow file for this run

name: Dispatch Configuration
on:
pull_request:
branches: [main]
types: [closed]
jobs:
set-limit:
if: ${{ github.event.pull_request.merged }}
name: Set changed routers limit
runs-on: ubuntu-latest
steps:
- name: Set limit
id: set-limit
run: |
echo "limit=$(curl -L -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DISPATCH_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
${{ github.api_url }}/repos/${{ github.repository }}/pulls/${{ github.event.number }}/files | \
jq -c '.[] | {filename}[]' | grep -o '\(router\.[a-z0-9]\+\)' | tr '\n' ',')" \
>> $GITHUB_OUTPUT
outputs:
limit: ${{ steps.set-limit.outputs.limit }}
dispatch:
name: Dispatch configuration job
needs: set-limit
runs-on: ubuntu-latest
steps:
- name: Dispatch peer configuration workflow
if: ${{ needs.set-limit.outputs.limit != '' }}
run: |
curl -H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" \
--request POST \
--data '{"event_type": "deploy_peers", "client_payload": {"limit": "${{ needs.set-limit.outputs.limit }}"}' \
${{ secrets.DISPATCH_URL }}