Add Atomberg fan #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Pull Request CodeQL" | |
on: | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
analyze: | |
name: Analyze | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: write | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
language: [ python ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# Make sure the actual branch is checked out when running on pull requests | |
ref: ${{ github.head_ref }} | |
# This is important to fetch the changes to the previous commit | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-device-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: codes/*/*.json | |
- name: Set up Python | |
if: steps.changed-device-files.outputs.any_changed == 'true' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.X" | |
- name: Test device code files | |
if: steps.changed-device-files.outputs.any_changed == 'true' | |
env: | |
ALL_CHANGED_DEVICE_FILES: ${{ steps.changed-device-files.outputs.all_changed_files }} | |
run: | | |
FILES="" | |
for file in ${ALL_CHANGED_DEVICE_FILES}; do | |
FILES="$FILES $file" | |
done | |
python3 test_device_data.py $FILES | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
queries: +security-and-quality | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v3 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/language:${{ matrix.language }}" | |
- name: Get changed files | |
id: changed-python-files | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: "**/*.py" | |
- name: Check Python files format | |
if: steps.changed-python-files.outputs.any_changed == 'true' | |
uses: psf/black@stable | |
with: | |
options: "" | |
src: ${{ steps.changed-python-files.outputs.all_changed_files }} | |
- name: Reformat JSON, YAML and MD files | |
uses: creyD/prettier_action@v4.3 | |
with: | |
only_changed: True | |
prettier_options: --write **/*.{json,yaml,md} | |
commit_message: ":art: Reformated Python, JSON, YAML and MD files" | |
commit_description: "" |