Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pr system for format issues #53

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ on:
name: Format

jobs:
format:
sonarqube:
name: SonarQube
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

prettier:
runs-on: ubuntu-latest

steps:
Expand All @@ -25,4 +37,28 @@ jobs:
run: npm ci

- name: Format Markdown files
run: npx prettier --check "**/*.{md,yaml,yml}"
run: npx prettier --write "**/*.{md,yaml,yml}"

- name: Commit changes
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m 'Format YAML files'
else
echo "No changes to commit"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Fix formatting issues"
branch: prettier-fix
branch-suffix: short-commit-hash
title: "Prettier: Fix formatting issues"
body: |
Fix prettier formattin issues
10 changes: 0 additions & 10 deletions .vscode/extensions.json

This file was deleted.

Loading