From 5037660b344c6ffe2662b738c512daeb306b881f Mon Sep 17 00:00:00 2001 From: rhysd Date: Thu, 7 Nov 2024 00:31:49 +0900 Subject: [PATCH] fix CodeQL workflow --- .github/workflows/codeql.yaml | 48 ++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 5aa9d1dae..c61bd675f 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -1,4 +1,4 @@ -name: "CodeQL" +name: CodeQL on: push: @@ -10,39 +10,47 @@ on: - cron: '41 21 * * 5' workflow_dispatch: -# This environment is necessary to avoid the following issue -# https://github.com/github/codeql/issues/6321 -env: - CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'on' +permissions: + security-events: write jobs: - analyze: - name: Analyze + analyze-go: + name: Analyze Go runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - strategy: - fail-fast: false - matrix: - language: ['go', 'javascript'] steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: '1.23' - if: ${{ matrix.language == 'go' }} - uses: github/codeql-action/init@v3 with: config-file: ./.github/codeql/codeql-config.yaml - languages: ${{ matrix.language }} - - uses: github/codeql-action/autobuild@v3 - if: ${{ matrix.language != 'go' }} + languages: go - name: Build Go sources run: | set -x go build -v ./cmd/actionlint GOOS=js GOARCH=wasm go build -v -o ./playground/main.wasm ./playground - if: ${{ matrix.language == 'go' }} - uses: github/codeql-action/analyze@v3 + with: + category: "/language:go" + analyze-ts: + name: Analyze TypeScript + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./playground + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "lts/*" + - uses: github/codeql-action/init@v3 + with: + config-file: ./.github/codeql/codeql-config.yaml + languages: javascript-typescript + - name: Build playground + run: make build + - uses: github/codeql-action/analyze@v3 + with: + category: "/language:javascript-typescript"