New logic

This commit is contained in:
Alexandre
2025-06-08 09:09:20 +02:00
committed by GitHub
parent 7c8a4dfac6
commit e02bde7073

View File

@@ -1,78 +1,48 @@
# This workflow executes several linters on changed files based on languages used in your code base whenever name: Lint
# you push a code or open a pull request.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/github/super-linter
---
name: Lint Code Base
on: on:
workflow_dispatch:
schedule: schedule:
- cron: "0 0 * * 0" - cron: "0 0 * * 0"
workflow_dispatch:
permissions:
contents: write
packages: read
statuses: write
jobs: jobs:
make-executable: super-lint:
if: github.repository_owner == 'alexbelgium' name: Lint and Autofix
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: permissions:
- name: Checkout Repo contents: write
uses: actions/checkout@v4 statuses: write
packages: read
- name: Make scripts executable
run: |
echo "Starting"
git config core.filemode true
# shellcheck disable=SC2086,SC2046
#git update-index --chmod=+x $(find . -type f -iname "*.sh")
chmod u+x $(find . -type f -iname "*.sh")
#git commit -am "fixing the script permissions..."
- name: Commit if needed
uses: EndBug/add-and-commit@v9
with:
commit: -u
message: "GitHub bot : scripts executable"
default_author: github_actions
run-lint:
runs-on: ubuntu-latest
needs: make-executable
steps: steps:
########################## - name: Checkout repository
# Checkout the code base #
##########################
- name: Checkout the code base
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0 fetch-depth: 0
#################### - name: Run Super Linter
# Run Super Linter # uses: super-linter/super-linter/slim@master
####################
- name: Lint Code Base
uses: docker://github/super-linter:slim-v4
env: env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_NATURAL_LANGUAGE: false FIX_SHELL_SHFMT: true
ACTION_ACTIONLINT_DISABLE_ERRORS: true FIX_YAML_PRETTIER: true
# Add more FIX_ variables as needed
- name: Check for linting changes
id: changed
run: |
git diff --quiet || echo "changed=true" >> $GITHUB_OUTPUT
check_crlf: - name: Create New Pull Request If Needed
name: Check CRLF action if: steps.changed.outputs.changed == 'true'
if: github.repository_owner == 'alexbelgium' uses: peter-evans/create-pull-request@v5
runs-on: ubuntu-latest with:
title: "Github bot : fix linting issues"
steps: commit_options: "--no-verify --signoff"
- name: Checkout repository contents commit_user_name: super-linter
uses: actions/checkout@v4 commit_user_email: super-linter@super-linter.dev
- name: Use action to check for CRLF endings
uses: erclu/check-crlf@v1.2.0
- name: check-mixed-line-endings
uses: ymwymw/check-mixed-line-endings@v2