diff --git a/.github/workflows/precheck.yml b/.github/workflows/precheck.yml index a7524ccb3..d7264c703 100644 --- a/.github/workflows/precheck.yml +++ b/.github/workflows/precheck.yml @@ -4,21 +4,32 @@ on: [pull_request] jobs: conflict-check: - runs-on: ubuntu-latest + runs-on: self-hosted + outputs: + conflict: ${{ steps.check-conflicts.outputs.conflict }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Check Conflicts + id: check-conflicts run: | git fetch origin main - if git diff --name-only --diff-filter=U origin/main...HEAD | grep .; then - echo "CONFLICT=true" >> $GITHUB_ENV - fi + $conflicts = git diff --name-only --diff-filter=U origin/main...HEAD + if ($conflicts) { + echo "conflict=true" >> $env:GITHUB_OUTPUT + Write-Host "Conflicts detected in files: $conflicts" + } else { + echo "conflict=false" >> $env:GITHUB_OUTPUT + Write-Host "No conflicts detected" + } + shell: pwsh labeler: - runs-on: ubuntu-latest + runs-on: self-hosted needs: conflict-check + if: needs.conflict-check.outputs.conflict == 'true' steps: - - uses: actions/github-script@v6 - if: env.CONFLICT == 'true' + - uses: actions/github-script@v7 with: script: | github.rest.issues.addLabels({ diff --git a/.github/workflows/ruff-pr.yml b/.github/workflows/ruff-pr.yml index bb83de8c9..552efbb89 100644 --- a/.github/workflows/ruff-pr.yml +++ b/.github/workflows/ruff-pr.yml @@ -1,9 +1,21 @@ -name: Ruff +name: Ruff PR Check on: [ pull_request ] jobs: ruff: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v4 - - uses: astral-sh/ruff-action@v3 + with: + fetch-depth: 0 + - name: Install Ruff and Run Checks + uses: astral-sh/ruff-action@v3 + with: + args: "--version" + version: "latest" + - name: Run Ruff Check (No Fix) + run: ruff check --output-format=github + shell: pwsh + - name: Run Ruff Format Check + run: ruff format --check --diff + shell: pwsh