From ee02622cf25da0f31f349b148b9b6d90563b22d4 Mon Sep 17 00:00:00 2001 From: zhongliang02 Date: Mon, 9 Dec 2024 08:52:57 +0800 Subject: [PATCH 1/3] feat: add ci checks --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3e96a40 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: 'CI' + +on: + pull_request: + branches: + - '**' + +jobs: + analyze: + name: Analyze (${{matrix.language}}) + runs-on: ${{(matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest'}} + timeout-minutes: ${{(matrix.language == 'swift' && 120) || 360}} + permissions: + packages: read + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: javascript-typescript + build-mode: none + steps: + - name: Checkout current repository + uses: actions/checkout@v4 + + - name: Checkout codeql-config repository + uses: actions/checkout@v4 + with: + repository: opengovsg/codeql-config + # path: codeql-config + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{matrix.language}} + build-mode: ${{matrix.build-mode}} + config-file: ./codeql-config.yml + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: '/language:${{matrix.language}}' + upload: 'never' \ No newline at end of file From fb0c3968807332143ec4a50d5390b76da875a728 Mon Sep 17 00:00:00 2001 From: zhongliang02 Date: Mon, 9 Dec 2024 09:16:47 +0800 Subject: [PATCH 2/3] fix: removed duplicate checkout action --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e96a40..673500e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,12 +25,6 @@ jobs: - name: Checkout current repository uses: actions/checkout@v4 - - name: Checkout codeql-config repository - uses: actions/checkout@v4 - with: - repository: opengovsg/codeql-config - # path: codeql-config - - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: From 1dc129d966b67cd5cfd8b51c405c67dc2b7df52a Mon Sep 17 00:00:00 2001 From: zhongliang02 Date: Mon, 9 Dec 2024 09:21:58 +0800 Subject: [PATCH 3/3] fix: add security events write to reduce configuration drift --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 673500e..2f6b094 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: runs-on: ${{(matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest'}} timeout-minutes: ${{(matrix.language == 'swift' && 120) || 360}} permissions: + security-events: write packages: read actions: read contents: read