| 1 |
# Copyright 2023 The Archivista Contributors |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
# For most projects, this workflow file will not need changing; you simply need |
| 16 |
# to commit it to your repository. |
| 17 |
# |
| 18 |
# You may wish to alter this file to override the set of languages analyzed, |
| 19 |
# or to provide custom queries or build logic. |
| 20 |
# |
| 21 |
# ******** NOTE ******** |
| 22 |
# We have attempted to detect the languages in your repository. Please check |
| 23 |
# the `language` matrix defined below to confirm you have the correct set of |
| 24 |
# supported CodeQL languages. |
| 25 |
# |
| 26 |
name: "CodeQL" |
| 27 |
|
| 28 |
on: |
| 29 |
push: |
| 30 |
branches: ["main"] |
| 31 |
pull_request: |
| 32 |
# The branches below must be a subset of the branches above |
| 33 |
branches: ["main"] |
| 34 |
schedule: |
| 35 |
- cron: "0 0 * * 1" |
| 36 |
|
| 37 |
permissions: |
| 38 |
contents: read |
| 39 |
|
| 40 |
jobs: |
| 41 |
analyze: |
| 42 |
name: Analyze |
| 43 |
runs-on: ubuntu-latest |
| 44 |
permissions: |
| 45 |
actions: read |
| 46 |
contents: read |
| 47 |
security-events: write |
| 48 |
|
| 49 |
strategy: |
| 50 |
fail-fast: false |
| 51 |
matrix: |
| 52 |
language: ["go"] |
| 53 |
# CodeQL supports [ $supported-codeql-languages ] |
| 54 |
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support |
| 55 |
|
| 56 |
steps: |
| 57 |
- name: Harden Runner |
| 58 |
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1 |
| 59 |
with: |
| 60 |
egress-policy: audit |
| 61 |
|
| 62 |
- name: Checkout repository |
| 63 |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 64 |
|
| 65 |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 66 |
with: |
| 67 |
go-version-file: "go.mod" |
| 68 |
|
| 69 |
# Initializes the CodeQL tools for scanning. |
| 70 |
- name: Initialize CodeQL |
| 71 |
uses: github/codeql-action/init@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5 |
| 72 |
with: |
| 73 |
languages: ${{ matrix.language }} |
| 74 |
# If you wish to specify custom queries, you can do so here or in a config file. |
| 75 |
# By default, queries listed here will override any specified in a config file. |
| 76 |
# Prefix the list here with "+" to use these queries and those in the config file. |
| 77 |
|
| 78 |
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). |
| 79 |
# If this step fails, then you should remove it and run the build manually (see below) |
| 80 |
- name: Autobuild |
| 81 |
uses: github/codeql-action/autobuild@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5 |
| 82 |
|
| 83 |
# âšī¸ Command-line programs to run using the OS shell. |
| 84 |
# đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
| 85 |
|
| 86 |
# If the Autobuild fails above, remove it and uncomment the following three lines. |
| 87 |
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. |
| 88 |
|
| 89 |
# - run: | |
| 90 |
# echo "Run, Build Application using script" |
| 91 |
# ./location_of_script_within_repo/buildscript.sh |
| 92 |
|
| 93 |
- name: Perform CodeQL Analysis |
| 94 |
uses: github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5 |
| 95 |
with: |
| 96 |
category: "/language:${{matrix.language}}" |