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: added audit cronjob #437

Merged
merged 4 commits into from
Aug 17, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
node-version: [ 16.x, 14.x, 12.x, 10.x ]
node-version: [ 18.x, 16.x, 14.x ]
outputs:
ACCEPTANCE_FAILURE_TAG: ${{ steps.failure_brew.outputs.FAILURE_TAG_BREW }}
steps:
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/audit-check-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Audit check job
on:
schedule:
- cron: '30 14 * * *'
- cron: '30 14 * * 3'
jobs:
audit-prod:
if: github.event.schedule == '30 14 * * *'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18.x, 16.x, 14.x]
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- run: make install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Run audit check
run: npm audit --production
- name: Notify Npm Audit Failed
if: ${{ failure() && github.ref == 'refs/heads/main' }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.ALERT_SLACK_WEB_HOOK }}
SLACK_COLOR: 'danger'
SLACK_USERNAME: CLI Github Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_ICON_EMOJI: ':github:'
SLACK_TITLE: "Twilio Cli"
SLACK_MESSAGE: 'Cli daily production audit test failed'
MSG_MINIMAL: actions url
SLACK_FOOTER: Posted automatically using GitHub Actions

audit-dev:
if: github.event.schedule == '30 14 * * 3'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [ 18.x, 16.x, 14.x ]
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- run: make install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Run audit check
run: npm audit --dev

- name: Notify Npm Audit Failed
if: ${{ failure() && github.ref == 'refs/heads/main' }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.ALERT_SLACK_WEB_HOOK }}
SLACK_COLOR: 'warning'
SLACK_USERNAME: CLI Github Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_ICON_EMOJI: ':github:'
SLACK_TITLE: "Twilio Cli"
SLACK_MESSAGE: 'Cli weekly dev audit test failed'
MSG_MINIMAL: actions url
SLACK_FOOTER: Posted automatically using GitHub Actions
2 changes: 1 addition & 1 deletion .github/workflows/cli-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16.x, 14.x, 12.x, 10.x]
node-version: [18.x, 16.x, 14.x]
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli-test-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 14.x, 12.x, 10.x]
node-version: [18.x, 16.x, 14.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cli-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [ 16.x, 14.x, 12.x, 10.x ]
node-version: [ 18.x, 16.x, 14.x]
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 14.x, 12.x, 10.x]
node-version: [18.x, 16.x, 14.x]
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 14.x, 12.x, 10.x]
node-version: [18.x, 16.x, 14.x]
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
[![Travis Build Status](https://travis-ci.com/twilio/twilio-cli.svg?branch=main)](https://travis-ci.com/twilio/twilio-cli.svg?branch=main) [![codecov](https://codecov.io/gh/twilio/twilio-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/twilio/twilio-cli)
[![Learn with TwilioQuest](https://img.shields.io/static/v1?label=TwilioQuest&message=Learn%20to%20contribute%21&color=F22F46&labelColor=1f243c&style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAASFBMVEUAAAAZGRkcHBwjIyMoKCgAAABgYGBoaGiAgICMjIyzs7PJycnMzMzNzc3UoBfd3d3m5ubqrhfrMEDu7u739/f4vSb/3AD///9tbdyEAAAABXRSTlMAAAAAAMJrBrEAAAKoSURBVHgB7ZrRcuI6EESdyxXGYoNFvMD//+l2bSszRgyUYpFAsXOeiJGmj4NkuWx1Qeh+Ekl9DgEXOBwOx+Px5xyQhDykfgq4wG63MxxaR4ddIkg6Ul3g84vCIcjPBA5gmUMeXESrlukuoK33+33uID8TWeLAdOWsKpJYzwVMB7bOzYSGOciyUlXSn0/ABXTosJ1M1SbypZ4O4MbZuIDMU02PMbauhhHMHXbmebmALIiEbbbbbUrpF1gwE9kFfRNAJaP+FQEXCCTGyJ4ngDrjOFo3jEL5JdqjF/pueR4cCeCGgAtwmuRS6gDwaRiGvu+DMFwSBLTE3+jF8JyuV1okPZ+AC4hDFhCHyHQjdjPHUKFDlHSJkHQXMB3KpSwXNGJPcwwTdZiXlRN0gSp0zpWxNtM0beYE0nRH6QIbO7rawwXaBYz0j78gxjokDuv12gVeUuBD0MDi0OQCLvDaAho4juP1Q/jkAncXqIcCfd+7gAu4QLMACCLxpRsSuQh0igu0C9Svhi7weAGZg50L3IE3cai4IfkNZAC8dfdhsUD3CgKBVC9JE5ABAFzg4QL/taYPAAWrHdYcgfLaIgAXWJ7OV38n1LEF8tt2TH29E+QAoDoO5Ve/LtCQDmKM9kPbvCEBApK+IXzbcSJ0cIGF6e8gpcRhUDogWZ8JnaWjPXc/fNnBBUKRngiHgTUSivSzDRDgHZQOLvBQgf8rRt+VdBUUhwkU6VpJ+xcOwQUqZr+mR0kvBUgv6cB4+37hQAkXqE8PwGisGhJtN4xAHMzrsgvI7rccXqSvKh6jltGlrOHA3Xk1At3LC4QiPdX9/0ndHpGVvTjR4bZA1ypAKgVcwE5vx74ulwIugDt8e/X7JgfkucBMIAr26ndnB4UCLnDOqvteQsHlgX9N4A+c4cW3DXSPbwAAAABJRU5ErkJggg==)](https://twil.io/learn-open-source)

## Requirements
Currently, Node 14+ is supported. We support the [LTS versions](https://nodejs.org/en/about/releases) of Node.

## Setup

Head over to the [Twilio CLI documentation](https://www.twilio.com/docs/twilio-cli/quickstart).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"ngrok": "^3.2.7"
},
"engines": {
"node": ">=10.12.0"
"node": ">=14.0.0"
},
"oclif": {
"commands": "./src/commands",
Expand Down