diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0529ce6..3d9eb5b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,10 +48,24 @@ jobs: run: dart fix --apply - name: Commit and Push changes + id: commit uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "style: auto-fix linting and formatting issues" branch: ${{ github.ref_name }} + continue-on-error: true + + - name: Create Pull Request if push failed + if: steps.commit.outcome == 'failure' && steps.commit.outputs.changes_detected == 'true' + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + base: ${{ github.ref_name }} + commit-message: "style: auto-fix linting and formatting issues" + title: "Auto-fix linting and formatting issues" + branch: ${{ github.ref_name }}-auto-fix-lint-${{ github.run_number }} + branch: auto-fix-lint-${{ github.run_number }} + delete-branch: true - name: Strip signing config to build debug APK safely without keystores run: | @@ -100,4 +114,4 @@ jobs: with: name: Updatium-Commit-${{ steps.vars.outputs.sha_short }} path: build/outputs/artifacts/ - retention-days: 14 # Keep artifacts for 14 days to save space \ No newline at end of file + retention-days: 14 # Keep artifacts for 14 days to save space diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0da6198a..531fb1e7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -52,10 +52,23 @@ jobs: run: dart fix --apply - name: Commit and Push changes + id: commit uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "style: auto-fix linting and formatting issues" branch: ${{ github.ref_name }} + continue-on-error: true + + - name: Create Pull Request if push failed + if: steps.commit.outcome == 'failure' + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "style: auto-fix linting and formatting issues" + title: "Auto-fix linting and formatting issues" + body: "Automated lint fixes applied by nightly workflow" + branch: auto-fix-lint-nightly-${{ github.run_number }} + delete-branch: true # Running sync script to ensure no broken dependencies before building - name: Run Environment Sync diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa26762c..b9a5e808 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,10 +38,23 @@ jobs: run: dart fix --apply - name: Commit and Push changes + id: commit uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "style: auto-fix linting and formatting issues" branch: ${{ github.ref_name }} + continue-on-error: true + + - name: Create Pull Request if push failed + if: steps.commit.outcome == 'failure' + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "style: auto-fix linting and formatting issues" + title: "Auto-fix linting and formatting issues" + body: "Automated lint fixes applied by release workflow" + branch: auto-fix-lint-release-${{ github.run_number }} + delete-branch: true - name: Extract Version id: extract_version