mirror of
https://github.com/konpa/devicon.git
synced 2025-03-14 09:49:41 +01:00
Fix the CodeQL workflow to run only on .github
(#1767)
* Update codeql-analysis to run on .github * Update .github/workflows/codeql-analysis.yml Co-authored-by: David Leal <halfpacho@gmail.com> --------- Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
parent
60b8436fe3
commit
ccf9fa4233
100
.github/workflows/codeql-analysis.yml
vendored
100
.github/workflows/codeql-analysis.yml
vendored
@ -6,56 +6,80 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches: [master, develop]
|
branches: [master, develop]
|
||||||
schedule:
|
schedule:
|
||||||
# ┌───────────── minute (0 - 59)
|
- cron: 30 1 * * 0 # Runs every Sunday 1:30 am UTC
|
||||||
# │ ┌───────────── hour (0 - 23)
|
|
||||||
# │ │ ┌───────────── day of the month (1 - 31)
|
|
||||||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
|
||||||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
|
||||||
# │ │ │ │ │
|
|
||||||
# │ │ │ │ │
|
|
||||||
# │ │ │ │ │
|
|
||||||
# * * * * *
|
|
||||||
- cron: '30 1 * * 0'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
CodeQL-Build:
|
CodeQL-Javascript:
|
||||||
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
# required for all workflows
|
|
||||||
security-events: write
|
security-events: write
|
||||||
|
|
||||||
# only required for workflows in private repositories
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v2
|
||||||
# Override language selection by uncommenting this and choosing your languages
|
|
||||||
with:
|
with:
|
||||||
languages: javascript, python
|
languages: javascript
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
|
||||||
# If this step fails, then you should remove it and run the build manually (see below).
|
|
||||||
- name: Autobuild
|
|
||||||
uses: github/codeql-action/autobuild@v2
|
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
|
||||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
||||||
|
|
||||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following
|
|
||||||
# three lines and modify them (or add more) to build your code if your
|
|
||||||
# project uses a compiled language
|
|
||||||
|
|
||||||
#- run: |
|
|
||||||
# make bootstrap
|
|
||||||
# make release
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v2
|
||||||
|
|
||||||
|
CodeQL-Python-dot-github:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
id: setup-python
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
if [ -f ${{ github.workspace }}/.github/scripts/requirements.txt ];
|
||||||
|
then pip install -r ${{ github.workspace }}/.github/scripts/requirements.txt;
|
||||||
|
fi
|
||||||
|
# Set the `CODEQL-PYTHON` environment variable to the Python executable
|
||||||
|
# that includes the dependencies
|
||||||
|
echo "CODEQL_PYTHON=${{ steps.setup-python.outputs.python-path }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: python
|
||||||
|
setup-python-dependencies: false
|
||||||
|
source-root: .github/
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
|
|
||||||
|
CodeQL-Python-rest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Find Python files outside the .github folder
|
||||||
|
id: find_files
|
||||||
|
run: |
|
||||||
|
python_files=$(find ${{ github.workspace }} -name "*.py" -type f -not -path '*/\.*' | wc -l)
|
||||||
|
echo "python_files=${python_files}" >> $GITHUB_OUTPUT
|
||||||
|
echo "$python_files Python files were found outside the .github folder."
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
if: ${{ steps.find_files.outputs.python_files != '0' }}
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: python
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
if: ${{ steps.find_files.outputs.python_files != '0' }}
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user