From 3d057669479d7662379f80bc0b1d77d2e41a459d Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Mon, 24 Feb 2025 15:02:53 -0800 Subject: [PATCH 1/4] chore(ci): skip auto commit if scoped token is not present --- .github/workflows/pre-commit.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 1b9128afb..6a3d33df3 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -12,15 +12,15 @@ jobs: pre-commit: runs-on: ubuntu-latest timeout-minutes: 10 + env: + REPO_SCOPED_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} steps: - name: Check out the repo uses: actions/checkout@v4 with: fetch-depth: 0 - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.ref }} - token: ${{ secrets.REPO_SCOPED_TOKEN || github.token }} + token: ${{ env.REPO_SCOPED_TOKEN || github.token }} - name: Setup environment uses: ./.github/actions/setup-environment @@ -38,8 +38,7 @@ jobs: shell: bash - uses: stefanzweifel/git-auto-commit-action@v5 - # Always commit changes even if pre-commit failed - if: always() && github.event_name == 'pull_request' + if: always() && ${{ env.REPO_SCOPED_TOKEN }} && github.event_name == 'pull_request' with: commit_message: "Automated pre-commit update" push_options: "--no-verify" From 193d5d1266e173a341114a54d1da454234e83571 Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Mon, 24 Feb 2025 15:23:55 -0800 Subject: [PATCH 2/4] pre commit error --- src/codegen/cli/workspace/decorators.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/codegen/cli/workspace/decorators.py b/src/codegen/cli/workspace/decorators.py index 128db7d0b..368dde8ae 100644 --- a/src/codegen/cli/workspace/decorators.py +++ b/src/codegen/cli/workspace/decorators.py @@ -1,4 +1,6 @@ import functools + + import sys from collections.abc import Callable From cd9dc885e2d1e0c96973dac3505561d55fb73ece Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Mon, 24 Feb 2025 15:36:00 -0800 Subject: [PATCH 3/4] change if statement --- .github/workflows/pre-commit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 6a3d33df3..153fe1d9b 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ env.REPO_SCOPED_TOKEN || github.token }} + token: ${{ env.REPO_SCOPED_TOKEN || github.token }} - name: Setup environment uses: ./.github/actions/setup-environment @@ -38,7 +38,7 @@ jobs: shell: bash - uses: stefanzweifel/git-auto-commit-action@v5 - if: always() && ${{ env.REPO_SCOPED_TOKEN }} && github.event_name == 'pull_request' + if: ${{ always() && env.REPO_SCOPED_TOKEN && github.event_name == 'pull_request' }} with: commit_message: "Automated pre-commit update" push_options: "--no-verify" From 7da18e0a886a25cd75ea54e45f17f263d3605d93 Mon Sep 17 00:00:00 2001 From: christinewangcw <146775704+christinewangcw@users.noreply.github.com> Date: Mon, 24 Feb 2025 23:37:07 +0000 Subject: [PATCH 4/4] Automated pre-commit update --- src/codegen/cli/workspace/decorators.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/codegen/cli/workspace/decorators.py b/src/codegen/cli/workspace/decorators.py index 368dde8ae..128db7d0b 100644 --- a/src/codegen/cli/workspace/decorators.py +++ b/src/codegen/cli/workspace/decorators.py @@ -1,6 +1,4 @@ import functools - - import sys from collections.abc import Callable