From ae323916b4611226a8a1a9ce755af055985698bd Mon Sep 17 00:00:00 2001 From: ctownshend Date: Tue, 6 Aug 2024 00:28:46 +1000 Subject: [PATCH 1/4] initial scan --- .github/workflows/build.yml | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..11681ad --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: CI Build and scan +on: [push, pull_request] +env: + SONATYPE_LIFECYCLE_APPLICATION_ID : ${{ github.head_ref || github.ref_name }} + # SONATYPE_LIFECYCLE_APPLICATION_ID: $(echo "${{ github.repository }}" | cut -d '/' -f2) + +jobs: + build: + name: Node.js + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: ["14.x"] + + steps: + - name: Checkout Nodegoat + uses: actions/checkout@master + with: + repository: OWASP/NodeGoat + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Run Build + run: npm -v + - name: Run Build + run: npm install + - name: Run Build + run: npm pack + + + - name: Sonatype Lifecycle Policy Evaluation + uses: sonatype-nexus-community/iq-github-action@v2 + with: + serverUrl: ${{ secrets.SONATYPE_LIFECYCLE_URL }} + username: ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }} + password: ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }} + applicationId: ${{ env.SONATYPE_LIFECYCLE_APPLICATION_ID }} + stage: Build + target: ./ + \ No newline at end of file From 28a56237938496fc11540769e24c63d9d926fdcf Mon Sep 17 00:00:00 2001 From: ctownshend Date: Tue, 6 Aug 2024 00:37:29 +1000 Subject: [PATCH 2/4] yes --- .github/workflows/build.yml | 51 +++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11681ad..0c5b415 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ env: # SONATYPE_LIFECYCLE_APPLICATION_ID: $(echo "${{ github.repository }}" | cut -d '/' -f2) jobs: - build: + build: name: Node.js runs-on: ubuntu-latest @@ -15,31 +15,32 @@ jobs: node-version: ["14.x"] steps: - - name: Checkout Nodegoat - uses: actions/checkout@master - with: - repository: OWASP/NodeGoat - - - name: Set up Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} + - name: Checkout Nodegoat + uses: actions/checkout@master + with: + repository: OWASP/NodeGoat - - name: Run Build - run: npm -v - - name: Run Build - run: npm install - - name: Run Build - run: npm pack - - - name: Sonatype Lifecycle Policy Evaluation + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Run Build + run: npm -v + - name: Run Build + run: npm install + - name: Run Build + run: npm pack + + + - name: Sonatype Lifecycle Policy Evaluation uses: sonatype-nexus-community/iq-github-action@v2 with: - serverUrl: ${{ secrets.SONATYPE_LIFECYCLE_URL }} - username: ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }} - password: ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }} - applicationId: ${{ env.SONATYPE_LIFECYCLE_APPLICATION_ID }} - stage: Build - target: ./ - \ No newline at end of file + serverUrl: ${{ secrets.SONATYPE_LIFECYCLE_URL }} + username: ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }} + password: ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }} + applicationId: ${{ env.SONATYPE_LIFECYCLE_APPLICATION_ID }} + stage: Build + target: ./ + \ No newline at end of file From be9a6418babea1b2f2824a59cd13b028fb094fb6 Mon Sep 17 00:00:00 2001 From: ctownshend Date: Tue, 6 Aug 2024 00:51:40 +1000 Subject: [PATCH 3/4] fix tabs to spaces --- .github/workflows/build.yml | 51 +++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c5b415..b471253 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,31 +16,54 @@ jobs: steps: - name: Checkout Nodegoat - uses: actions/checkout@master - with: + uses: actions/checkout@master + with: repository: OWASP/NodeGoat - - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - - name: Run Build + - name: Check version run: npm -v - name: Run Build run: npm install - name: Run Build run: npm pack - - - name: Sonatype Lifecycle Policy Evaluation uses: sonatype-nexus-community/iq-github-action@v2 with: - serverUrl: ${{ secrets.SONATYPE_LIFECYCLE_URL }} - username: ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }} - password: ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }} - applicationId: ${{ env.SONATYPE_LIFECYCLE_APPLICATION_ID }} - stage: Build - target: ./ - \ No newline at end of file + serverUrl: ${{ secrets.SONATYPE_LIFECYCLE_URL }} + username: ${{ secrets.SONATYPE_LIFECYCLE_USERNAME }} + password: ${{ secrets.SONATYPE_LIFECYCLE_PASSWORD }} + applicationId: ${{ env.SONATYPE_LIFECYCLE_APPLICATION_ID }} + stage: Build + target: ./ + + +name: Lint +on: [push, pull_request] + +jobs: + lint: + name: Node.js + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: ["14.x"] + + steps: + - name: Checkout https://github.com/${{ github.repository }}@${{ github.ref }} + uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Run linter + run: npx --no-install jshint@2.12.0 . \ No newline at end of file From e8aa50b8a826a9912e81b1f01f4be5ababc61e6b Mon Sep 17 00:00:00 2001 From: ctownshend Date: Tue, 6 Aug 2024 00:53:00 +1000 Subject: [PATCH 4/4] remove duplicate lines --- .github/workflows/build.yml | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b471253..b01e3d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,30 +40,3 @@ jobs: stage: Build target: ./ - -name: Lint -on: [push, pull_request] - -jobs: - lint: - name: Node.js - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - node-version: ["14.x"] - - steps: - - name: Checkout https://github.com/${{ github.repository }}@${{ github.ref }} - uses: actions/checkout@v2 - with: - persist-credentials: false - - - name: Set up Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - - name: Run linter - run: npx --no-install jshint@2.12.0 . \ No newline at end of file