diff --git a/.github/workflows/biome-migrate.yaml b/.github/workflows/fixs.yaml similarity index 54% rename from .github/workflows/biome-migrate.yaml rename to .github/workflows/fixs.yaml index f9fdc34..cfe674d 100644 --- a/.github/workflows/biome-migrate.yaml +++ b/.github/workflows/fixs.yaml @@ -1,4 +1,4 @@ -name: Biome Migration +name: Additional fixs permissions: contents: write @@ -8,11 +8,54 @@ env: LEFTHOOK: 0 CI: true -on: - pull_request: - types: [opened, edited, synchronize] +on: pull_request jobs: + lint: + name: ✍️ Fix lint errors + runs-on: ubuntu-latest + if: contains(github.event.pull_request.title, 'ci(changesets)') + + steps: + - name: 🦖 Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + + - name: 🔻 Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 🏃 Run Node and NPM setup + uses: ./.github/actions/setup-project + + - name: "✍️ Lint: fix errors" + id: migration + run: | + pnpm lint:fix + # Check for changes + if git diff --name-only --exit-code; then + echo "has_changes=false" >> $GITHUB_OUTPUT + else + echo "has_changes=true" >> $GITHUB_OUTPUT + fi + + - name: 💭 Get current branch name + id: get_branch + if: ${{ steps.migration.outputs.has_changes == 'true' }} + run: echo "BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + + - name: 📥 Checkout current branch + if: ${{ steps.migration.outputs.has_changes == 'true' }} + run: git checkout ${{ steps.get_branch.outputs.BRANCH_NAME }} + + - name: 📤 Commit changes + if: ${{ steps.migration.outputs.has_changes == 'true' }} + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "fix(lint): safe errors" || echo "No changes to commit" + git push biome-migration: name: ✍️ Migrate Biome runs-on: ubuntu-latest diff --git a/.github/workflows/lint-ci-prs.yaml b/.github/workflows/lint-ci-prs.yaml deleted file mode 100644 index 3f21b55..0000000 --- a/.github/workflows/lint-ci-prs.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: Lint & Fix CI PRs - -permissions: - contents: write - packages: write - -env: - LEFTHOOK: 0 - CI: true - -on: - pull_request: - types: [opened, edited, synchronize] - -jobs: - lint: - name: ✍️ Fix lint errors - runs-on: ubuntu-latest - if: contains(github.event.pull_request.title, 'ci(changesets)') - - steps: - - name: 🦖 Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.12.1 - - - name: 🔻 Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: 🏃 Run Node and NPM setup - uses: ./.github/actions/setup-project - - - name: "✍️ Lint: fix errors" - id: migration - run: | - pnpm lint:fix - # Check for changes - if git diff --name-only --exit-code; then - echo "has_changes=false" >> $GITHUB_OUTPUT - else - echo "has_changes=true" >> $GITHUB_OUTPUT - fi - - - name: 💭 Get current branch name - id: get_branch - if: ${{ steps.migration.outputs.has_changes == 'true' }} - run: echo "BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT - - - name: 📥 Checkout current branch - if: ${{ steps.migration.outputs.has_changes == 'true' }} - run: git checkout ${{ steps.get_branch.outputs.BRANCH_NAME }} - - - name: 📤 Commit changes - if: ${{ steps.migration.outputs.has_changes == 'true' }} - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "fix(lint): safe errors" || echo "No changes to commit" - git push \ No newline at end of file