Skip to content

Commit

Permalink
TOFIX: code scanning
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Feb 12, 2025
1 parent 5fa9491 commit 63e36b0
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/code_scanning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,43 @@ on:
golang_version:
required: true
type: string
pull_request:
types:
- opened
- synchronize
branches:
- main
- release-*
# pull_request:
# types:
# - opened
# - synchronize
# branches:
# - main
# - release-*


jobs:
# TODO: Is there a way that we can only invoke this if this is a PR?
optionalVariables:
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/workflows/variables.yaml
# optionalVariables:
# if: ${{ github.event_name == 'pull_request' }}
# uses: ./.github/workflows/variables.yaml

variables:
runs-on: ubuntu-latest
needs:
- optionalVariables
if: always()
outputs:
golang_version: ${{ steps.golang_output.outputs.golang_version }}
steps:
- name: Check out code
uses: actions/checkout@v4
- id: golang_version
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
GOLANG_VERSION="${{ needs.optionalVariables.output.golang_version }}"
else
GOLANG_VERSION="${{ inputs.golang_version}}"
fi
echo "golang_version=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_OUTPUT
# variables:
# runs-on: ubuntu-latest
# needs:
# - optionalVariables
# if: always()
# outputs:
# golang_version: ${{ steps.golang_output.outputs.golang_version }}
# steps:
# - name: Check out code
# uses: actions/checkout@v4
# - id: golang_version
# run: |
# if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# GOLANG_VERSION="${{ needs.optionalVariables.output.golang_version }}"
# else
# GOLANG_VERSION="${{ inputs.golang_version}}"
# fi
# echo "golang_version=${GOLANG_VERSION##GOLANG_VERSION ?= }" >> $GITHUB_OUTPUT

analyze:
needs:
- variables
# needs:
# - variables
name: Analyze Go code with CodeQL
if: always()
runs-on: ubuntu-latest
Expand All @@ -71,7 +71,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ needs.variables.outputs.golang_version }}
go-version: ${{ inputs.golang_version }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down

0 comments on commit 63e36b0

Please sign in to comment.