From 9a82d9be6c8775318baf08ea75131dda2ae85f98 Mon Sep 17 00:00:00 2001 From: Adam Smith Date: Sun, 31 Mar 2024 12:19:15 -0400 Subject: [PATCH] feat: comment on merged PR that deployment has started --- .github/templates/deploy_started.tmpl | 15 +++++++++ .github/workflows/deploy_started.yml | 48 +++++++++++++++++++++++++++ routers/router.iad1.yml | 2 +- 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .github/templates/deploy_started.tmpl create mode 100644 .github/workflows/deploy_started.yml diff --git a/.github/templates/deploy_started.tmpl b/.github/templates/deploy_started.tmpl new file mode 100644 index 0000000..36077b0 --- /dev/null +++ b/.github/templates/deploy_started.tmpl @@ -0,0 +1,15 @@ +Hello, + +We have started the deployment of new configuration on our side for the peering at our $POP_UPPERCASE PoP. +It is ready for the configuration on your side. + +You can use our Nodes page for PoP information to be used: https://dn42.routedbits.com/nodes/#${POP_LOWERCASE} + +We manage configuration via our dn42-peers repository, you can submit pull requests to add/remove/change your own peerings. Once accepted and merged, the changes are pushed to our routers within a few minutes. + +Pull Request: [routedbits/dn42-peers#$PULL_REQUEST_ID](https://github.com/routedbits/dn42-peers/pull/$PULL_REQUEST_ID) + +Let us know if you have any questions or issues. + +Thanks, +NOC, RoutedBits diff --git a/.github/workflows/deploy_started.yml b/.github/workflows/deploy_started.yml new file mode 100644 index 0000000..c7e0c1e --- /dev/null +++ b/.github/workflows/deploy_started.yml @@ -0,0 +1,48 @@ +name: Comment Deployment Started + +on: + pull_request: + branches: [main] + types: [closed] + +jobs: + set-limit: + if: ${{ github.event.pull_request.merged }} + name: Collect routers + runs-on: ubuntu-latest + steps: + - uses: tj-actions/changed-files@v44 + with: + files: | + routers/** + write_output_files: true + + - id: set-limit + run: | + echo "limit=$(cat .github/outputs/all_changed_files.txt | grep -E -o '([a-z]{3}[0-9]{1})' | jq -Rcn '[inputs]')" >> $GITHUB_OUTPUT + outputs: + limit: ${{ steps.set-limit.outputs.limit }} + + comment_on_pr: + name: Comment on Pull Request + needs: set-limit + runs-on: ubuntu-latest + strategy: + matrix: + limit: ${{ fromJson(needs.set-limit.outputs.limit) }} + steps: + - uses: actions/checkout@v4 + + - run: | + echo "POP_UPPERCASE=$(echo ${{ matrix.limit }} | tr '[:lower:]' '[:upper:]')" >> $GITHUB_ENV + echo "POP_LOWERCASE=$(echo ${{ matrix.limit }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + echo "PULL_REQUEST_ID=${{ github.event.number }}" >> $GITHUB_ENV + + - run: envsubst < .github/templates/deploy_started.tmpl > .github/deploy_started.txt + + - uses: thollander/actions-comment-pull-request@v2 + with: + filePath: .github/deploy_started.txt + comment_tag: ${{ matrix.limit }} + pr_number: ${{ github.event.number }} + diff --git a/routers/router.iad1.yml b/routers/router.iad1.yml index 1045dac..f79c489 100644 --- a/routers/router.iad1.yml +++ b/routers/router.iad1.yml @@ -14,7 +14,7 @@ - name: YZGUY-IAD asn: 4242421669 - ipv6: fe80::1669 + ipv6: fe80::1770 multiprotocol: true extended_nexthop: true sessions: