Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: comment deploy started on merged pull requests #91

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/templates/deploy_started.tmpl
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions .github/workflows/deploy_started.yml
Original file line number Diff line number Diff line change
@@ -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 }}

2 changes: 1 addition & 1 deletion routers/router.iad1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

- name: YZGUY-IAD
asn: 4242421669
ipv6: fe80::1669
ipv6: fe80::1770
multiprotocol: true
extended_nexthop: true
sessions:
Expand Down