Skip to content

Automated: Auto Fix Linter #145

Automated: Auto Fix Linter

Automated: Auto Fix Linter #145

Workflow file for this run

name: CI / Lint
on:
schedule:
- cron: '0 */4 * * *'
push:
branches: ['dev', '**']
pull_request:
branches: ['dev', '**']
workflow_dispatch:
permissions:
contents: write
packages: read
statuses: write
jobs:
auto-fix:
name: Auto Fix Linter Issues
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Install Dependencies
id: install
run: npm run setup
- name: Run Auto Fixer
run: npm run auto-fix
- name: Create PR
id: create-pr
uses: peter-evans/create-pull-request@v7
with:
delete-branch: false
title: 'Automated: Auto Fix Linter'
committer: 'Hamster [bot] <TheHamsterBot@outlook.com>'
commit-message: 'Publish Linter Changes and Fixes'
branch: 'auto-fixer/linter'
assignees: 'TheHamsterBot'
labels: |
bot
automated
hamster
reviewers: offensive-vk
base: fix-actions
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
body: |
timestamp=$(date '+%b %d, %A %I:%M:%S %p')
markdown=$(cat <<EOF
## This Pull Request Was Automated by [Hamster [bot]](https://github.com/TheHamsterBot)
> [!NOTE]
> Workflow Trigger: ${{ github.event_name }} event at ${{ github.event_path }}
> Details of Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- Author: @TheHamsterBot
- Branch: ${{ github.event.base_ref }} (base) / ${{ github.event.head_ref }} (head)
- Commit: ${{ github.sha }}
- Workflow Path: ${{ github.workflow }}
- Pull Request Number: #${{ steps.create-pr.outputs.pr_number }}
- Pusher Details: ${{ github.event.pusher.name }} - ${{ github.event.pusher.email }}
- Commit Info: ${{ github.event.head_commit.message }}
---
Thanks.
$timestamp
Your Hamster 🐹 <code>PF78VAPPKLZ2</code>
EOF)
lint:
name: Begin Linting
runs-on: ubuntu-latest
needs: [auto-fix]
continue-on-error: true
strategy:
fail-fast: true
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Install Dependencies
id: install
run: npx pnpm i
- name: Lint Codebase
id: super-linter
uses: super-linter/super-linter/slim@v7
env:
DEFAULT_BRANCH: dev
FILTER_REGEX_EXCLUDE: dist/**/*
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_JSCPD: false
VALIDATE_TYPESCRIPT_STANDARD: false