Skip to content

Commit

Permalink
Merge pull request #304 from ArielSAdamsNASA/fix-264-CodeQL-dependent…
Browse files Browse the repository at this point in the history
…-on-successful-build

Fix #264, CodeQL Dependent on a Successful Build
  • Loading branch information
astrogeco authored Jul 21, 2021
2 parents 6df5bdc + a146436 commit da741e1
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/codeql-build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
name: "CodeQL Analysis"

# Only trigger, when the build workflow succeeded
on:
push:
pull_request:
branches:
- main

workflow_run:
workflows: ["Build, Test, and Run \\[OMIT_DEPRECATED=true\\]"]
types:
- completed
branches:
- '**'
env:
SIMULATION: native
ENABLE_UNIT_TESTS: true
OMIT_DEPRECATED: true
BUILDTYPE: release


jobs:
#Checks for duplicate actions. Skips push actions if there is a matching or duplicate pull-request action.
check-for-duplicates:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
Expand Down Expand Up @@ -117,7 +121,7 @@ jobs:
run: |
cp ./cfe/cmake/Makefile.sample Makefile
cp -r ./cfe/cmake/sample_defs sample_defs
# Setup the build system
- name: Make Install
if: ${{ !steps.skip-workflow.outputs.skip }}
Expand All @@ -127,3 +131,10 @@ jobs:
- name: Perform CodeQL Analysis
if: ${{ !steps.skip-workflow.outputs.skip }}
uses: github/codeql-action/analyze@v1

on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Fail workflow
run: exit 1

0 comments on commit da741e1

Please sign in to comment.