github.com/yaling888/clash@v1.53.0/.github/workflows/codeql-analysis.yml (about)

     1  name: CodeQL
     2  
     3  on:
     4    push:
     5      branches: [plus-pro]
     6  
     7  jobs:
     8    analyze:
     9      name: Analyze
    10      runs-on: ubuntu-latest
    11  
    12      strategy:
    13        fail-fast: false
    14        matrix:
    15          language: ['go']
    16  
    17      steps:
    18        - name: Checkout repository
    19          uses: actions/checkout@v4
    20  
    21        - name: Get latest go version
    22          id: version
    23          run: |
    24            go_mod_version=$(cat go.mod | grep -oE '^go [0-9]{1,}.[0-9|a-z]{1,}(.[0-9]{1,})?' | awk '(NR==1){printf $2}')
    25            latest_go_version=$(curl -sSL https://go.dev/dl/?mode=json | grep "version" | cut -d\" -f4 | awk -Fgo '(NR==1){printf $2}') || ""
    26            go_version="$latest_go_version"
    27  
    28            if [[ -z "$latest_go_version" ]] || [[ $go_mod_version =~ .*[rc|beta].* ]]; then
    29              go_version="$go_mod_version"
    30            fi
    31  
    32            echo "go_version=${go_version}" >> $GITHUB_OUTPUT
    33  
    34        - name: Setup Go
    35          uses: actions/setup-go@v5
    36          with:
    37            go-version: ${{ steps.version.outputs.go_version }}
    38            check-latest: true
    39            cache: false
    40  
    41        - name: Initialize CodeQL
    42          uses: github/codeql-action/init@v3
    43          with:
    44            languages: ${{ matrix.language }}
    45  
    46        #- name: Autobuild
    47        #  uses: github/codeql-action/autobuild@v3
    48  
    49        - name: Build
    50          env:
    51            NAME: clash-plus-pro
    52            BINDIR: bin
    53          run: make docker
    54  
    55        - name: Perform CodeQL Analysis
    56          uses: github/codeql-action/analyze@v3