Skip to content

Commit 2942e08

Browse files
traskanuraaga
andauthored
Sync CodeQL workflow with instrumentation repo (#243)
* Sync CodeQL workflow with instrumentation repo * Bump to Java 17 * Update .github/workflows/nightly-codeql-analysis.yml Co-authored-by: Anuraag Agrawal <[email protected]> Co-authored-by: Anuraag Agrawal <[email protected]>
1 parent 415b9ab commit 2942e08

File tree

3 files changed

+57
-30
lines changed

3 files changed

+57
-30
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "{{ env.GITHUB_WORKFLOW }} #{{ env.GITHUB_RUN_NUMBER }} failed"
3+
labels: bug, area:build, priority:p1
4+
---
5+
<a href="https://github.com/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}">
6+
{{ env.GITHUB_WORKFLOW }} #{{ env.GITHUB_RUN_NUMBER }}</a> failed. Please take a look and fix it ASAP.

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Nightly CodeQL analysis
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '30 1 * * *'
7+
8+
jobs:
9+
analyze:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup Java 17
16+
uses: actions/setup-java@v2
17+
with:
18+
distribution: temurin
19+
java-version: 17
20+
21+
- name: Initialize CodeQL
22+
uses: github/codeql-action/init@v1
23+
with:
24+
languages: java
25+
26+
- uses: gradle/gradle-build-action@v2
27+
with:
28+
# skipping build cache is needed so that all modules will be analyzed
29+
arguments: assemble --no-build-cache
30+
31+
- name: Perform CodeQL Analysis
32+
uses: github/codeql-action/analyze@v1
33+
34+
issue:
35+
name: Open issue on failure
36+
needs: analyze
37+
runs-on: ubuntu-latest
38+
if: always()
39+
steps:
40+
# run this action to get workflow conclusion
41+
# You can get conclusion by env (env.WORKFLOW_CONCLUSION)
42+
- uses: technote-space/[email protected]
43+
44+
- uses: actions/checkout@v3
45+
46+
- uses: JasonEtco/[email protected]
47+
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
filename: .github/templates/workflow-failed.md

0 commit comments

Comments
 (0)