Skip to content

Commit 51a77e1

Browse files
authored
Merge pull request #61 from advanced-security/copilot/add-ci-workflow-for-prs
Add CI workflow and fix axios CVEs in remediateGoogleAPIKey
2 parents 09a5f0c + 7eec56f commit 51a77e1

File tree

3 files changed

+56
-20
lines changed

3 files changed

+56
-20
lines changed

.github/workflows/test.yaml

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,65 @@
1-
name: Testing GSSAR
1+
name: CI
2+
permissions:
3+
contents: read
24
"on":
35
push:
46
branches:
57
- main
6-
- ft/**
7-
- bug/**
8-
- hotfix/**
9-
- release/**
108
pull_request:
119
branches:
1210
- main
13-
- ft/**
14-
- bug/**
15-
- hotfix/**
16-
- release/**
1711
jobs:
18-
LintCloudFormation:
19-
permissions:
20-
contents: read
12+
lint-and-format:
13+
name: Lint & Format Check
2114
runs-on: ubuntu-latest
2215
steps:
2316
- name: Checkout
24-
uses: actions/checkout@v2
25-
- name: Setup Cloud Formation Linter with Latest Version
17+
uses: actions/checkout@v4
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: "20"
22+
- name: Install dependencies
23+
run: yarn install --frozen-lockfile
24+
- name: Run Prettier check
25+
run: yarn run prettier-check
26+
- name: Run ESLint check
27+
run: yarn run lint-check
28+
29+
lint-cloudformation:
30+
name: CloudFormation Lint
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
- name: Setup CloudFormation Linter
2636
uses: scottbrenner/cfn-lint-action@v2
27-
- name: Print the Cloud Formation Linter Version & run Linter.
28-
run: |
29-
cfn-lint -t ./template.yml
37+
- name: Run CloudFormation Linter
38+
run: cfn-lint -t ./template.yml
39+
40+
build-functions:
41+
name: Build ${{ matrix.function }}
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
function:
46+
- functions/authorizers/githubWebhookIPValidator
47+
- functions/authorizers/githubWebhookSecretValidator
48+
- functions/helpers/getSecretDetails
49+
- functions/helpers/closeSecret
50+
- functions/helpers/githubIssueNotifier
51+
- functions/remediators/remediateAWSAccessKey
52+
- functions/remediators/remediateGoogleAPIKey
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v4
56+
- name: Setup Node.js
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: "20"
60+
- name: Install dependencies
61+
working-directory: ${{ matrix.function }}
62+
run: yarn install --frozen-lockfile
63+
- name: Build
64+
working-directory: ${{ matrix.function }}
65+
run: yarn run build

functions/remediators/remediateGoogleAPIKey/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"@types/node": "^18.11.17",
1919
"@typescript-eslint/eslint-plugin": "^5.47.0",
2020
"@typescript-eslint/parser": "^5.47.0",
21+
"axios": "^1.15.0",
2122
"eslint": "^8.30.0",
2223
"eslint-config-prettier": "^8.5.0",
2324
"eslint-plugin-prettier": "^4.2.1",
2425
"prettier": "^2.8.1",
2526
"ts-node": "^10.9.1",
2627
"tslib": "^2.4.1",
27-
"typescript": "^4.9.4",
28-
"axios": "^1.15.0"
28+
"typescript": "^4.9.4"
2929
},
3030
"engines": {
3131
"node": "20"

functions/remediators/remediateGoogleAPIKey/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ asynckit@^0.4.0:
11051105

11061106
axios@^1.15.0:
11071107
version "1.15.0"
1108-
resolved "https://registry.yarnpkg.com/axios/-/axios-1.15.0.tgz#0fcee91ef03d386514474904b27863b2c683bf4f"
1108+
resolved "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz"
11091109
integrity sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==
11101110
dependencies:
11111111
follow-redirects "^1.15.11"

0 commit comments

Comments
 (0)