nightly-codeql-analysis.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Nightly CodeQL analysis
  2. on:
  3. workflow_dispatch:
  4. schedule:
  5. - cron: '30 1 * * *'
  6. jobs:
  7. analyze:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout repository
  11. uses: actions/checkout@v2.3.4
  12. with:
  13. fetch-depth: 0
  14. - name: Initialize CodeQL
  15. uses: github/codeql-action/init@v1
  16. with:
  17. languages: java
  18. - name: Setup Java 11
  19. uses: actions/setup-java@v2
  20. with:
  21. distribution: adopt
  22. java-version: 11
  23. - name: Autobuild
  24. uses: github/codeql-action/autobuild@v1
  25. - name: Perform CodeQL Analysis
  26. uses: github/codeql-action/analyze@v1
  27. issue:
  28. name: Open issue on failure
  29. needs: analyze
  30. runs-on: ubuntu-latest
  31. if: always()
  32. steps:
  33. # run this action to get workflow conclusion
  34. # You can get conclusion by env (env.WORKFLOW_CONCLUSION)
  35. - uses: technote-space/workflow-conclusion-action@v2.2
  36. - uses: actions/checkout@v2.3.4
  37. with:
  38. fetch-depth: 0
  39. - uses: JasonEtco/create-an-issue@v2.6
  40. if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
  41. env:
  42. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  43. with:
  44. filename: .github/templates/workflow-failed.md