codeql: Remove unneeded steps (#2336)
Remove executing build and test, there is a special workflow for this and CodeQL does not require running any go code or building the app Remove `git checkout HEAD^2`, not needed anymore: Warning: 1 issue was detected with this workflow: git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results. Add permission to write the security events
This commit is contained in:
		
							parent
							
								
									8cb9c769ff
								
							
						
					
					
						commit
						f47f4f5557
					
				
							
								
								
									
										26
									
								
								.github/workflows/codeql.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								.github/workflows/codeql.yaml
									
									
									
									
										vendored
									
									
								
							@ -19,34 +19,21 @@ jobs:
 | 
			
		||||
    name: Analyze
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
 | 
			
		||||
    permissions:
 | 
			
		||||
      # required for all workflows
 | 
			
		||||
      security-events: write
 | 
			
		||||
 | 
			
		||||
    strategy:
 | 
			
		||||
      fail-fast: false
 | 
			
		||||
      matrix:
 | 
			
		||||
        # Override automatic language detection by changing the below list
 | 
			
		||||
        # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
 | 
			
		||||
        # TODO: Enable for javascript later
 | 
			
		||||
        language: [ 'go' ]
 | 
			
		||||
        golang: [ '1.16' ]
 | 
			
		||||
        # Learn more...
 | 
			
		||||
        # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
 | 
			
		||||
        language: [ 'go']
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Checkout repository
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
        with:
 | 
			
		||||
          # We must fetch at least the immediate parents so that if this is
 | 
			
		||||
          # a pull request then we can checkout the head.
 | 
			
		||||
          fetch-depth: 2
 | 
			
		||||
 | 
			
		||||
      # If this run was triggered by a pull request event, then checkout
 | 
			
		||||
      # the head of the pull request instead of the merge commit.
 | 
			
		||||
      - run: git checkout HEAD^2
 | 
			
		||||
        if: ${{ github.event_name == 'pull_request' }}
 | 
			
		||||
 | 
			
		||||
      - name: Install Go
 | 
			
		||||
        uses: actions/setup-go@v2
 | 
			
		||||
        with:
 | 
			
		||||
          go-version: ${{ matrix.golang }}
 | 
			
		||||
 | 
			
		||||
      # Initializes the CodeQL tools for scanning.
 | 
			
		||||
      - name: Initialize CodeQL
 | 
			
		||||
@ -58,8 +45,5 @@ jobs:
 | 
			
		||||
          # Prefix the list here with "+" to use these queries and those in the config file.
 | 
			
		||||
          # queries: ./path/to/local/query, your-org/your-repo/queries@main
 | 
			
		||||
 | 
			
		||||
      # Use manual build instead of auto build
 | 
			
		||||
      - run: make build test
 | 
			
		||||
 | 
			
		||||
      - name: Perform CodeQL Analysis
 | 
			
		||||
        uses: github/codeql-action/analyze@v1
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user