mirror of
https://github.com/labring/sealos.git
synced 2026-10-30 18:09:56 +08:00
50 lines
1.1 KiB
YAML
Executable File
50 lines
1.1 KiB
YAML
Executable File
name: Check-Format-Code
|
|
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [ "main" ]
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "**/*.md"
|
|
- "**/*.yaml"
|
|
- "CHANGELOG/**"
|
|
pull_request:
|
|
branches: [ "*" ]
|
|
paths-ignore:
|
|
- "docs/**"
|
|
- "**/*.md"
|
|
- "**/*.yaml"
|
|
- "CHANGELOG/**"
|
|
env:
|
|
# Common versions
|
|
GO_VERSION: "1.23"
|
|
PROJECT_PATH: "./lifecycle"
|
|
|
|
jobs:
|
|
format-code:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- name: Setup Golang with cache
|
|
uses: magnetikonline/action-golang-cache@v5
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
- name: Format Code
|
|
env:
|
|
PROJECT_PATH: ${{ env.PROJECT_PATH }}
|
|
run: cd "$PROJECT_PATH" && make format
|
|
|
|
- name: Commit Changes
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
commit_message: "chore(fmt): format code"
|
|
commit_options: "-s"
|