Update cidrs.json #295
This file contains 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: Update cidrs.json | |
# Runs nightly and manually | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
update_generated_files: | |
name: Update automatically generated files | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ^18.x | |
cache: 'npm' | |
- name: Install npm@8 | |
run: | | |
npm install -g npm@8 | |
- name: Install Dependencies | |
run: | | |
npm -v | |
npm i | |
# make sure precommit.js is compiled | |
npm run bootstrap-ci -- --scope @mongodb-js/monorepo-tools --stream --include-dependencies | |
- name: Update cidrs.json | |
run: npm run -w packages/mongodb-cloud-info update-cidrs | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: Update report | |
branch: ci/update-cidrs | |
title: 'chore: update cidrs.json' | |
add-paths: | | |
resources/cidrs.json | |
body: | | |
- Update `cidrs.json` | |
- name: Merge PR | |
env: | |
PULL_REQUEST_NUMBER: ${{steps.cpr.outputs.pull-request-number}} | |
# NOTE: we don't use a PAT so to not trigger further automation | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh pr merge $PULL_REQUEST_NUMBER --squash --delete-branch |