-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (45 loc) · 1.4 KB
/
update-cidrs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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