From 1fe1cc462abdbacb250a9b74c589158322657bbf Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 4 Dec 2024 17:57:30 +0000 Subject: [PATCH 1/2] Update format.yml --- .github/workflows/format.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 66a1318632..f11721be25 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -22,9 +22,11 @@ jobs: python-version: ${{ env.python_version }} - name: Format modified python files + env: + filter: ${{ github.event.before }} run: | python3 -m pip install autopep8 - for FILE in $(git diff --name-only ${{ github.event.before }} | grep -E '.*\.py$') + for FILE in $(git diff --name-only $filter | grep -E '.*\.py$') do # Check if the file still exists in the working tree if [ -f "$FILE" ]; then @@ -34,8 +36,10 @@ jobs: done - name: Format modified C++ files + env: + filter: ${{ github.event.before }} run: | - for FILE in $(git diff --name-only ${{ github.event.before }} | grep -E '.*\.(cc|cpp|h|hpp)$') + for FILE in $(git diff --name-only $filter | grep -E '.*\.(cc|cpp|h|hpp)$') do # Check if the file still exists in the working tree if [ -f "$FILE" ]; then @@ -44,7 +48,7 @@ jobs: fi done - - name: Commit and create PR + - name: Commit and Push run: | HAS_CHANGES=$(git diff --staged --name-only) if [ ${#HAS_CHANGES} -gt 0 ]; then @@ -54,13 +58,4 @@ jobs: git commit -m '[Automated Commit] Format Codebase' git push - # Push changes to a new branch - #BRANCH_NAME="auto/code-format" - #git branch $BRANCH_NAME - #git push origin $BRANCH_NAME --force - - # Create a pull request to the "code-format" branch - #gh pr create --base code-format --head $BRANCH_NAME --title "[Automated PR] Format Codebase" --body "This pull request contains automated code formatting changes." fi - # env: - # GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} From bd9143cf708ebb1846cc1feba0cb9d40d3e3a4d8 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 4 Dec 2024 19:22:22 +0000 Subject: [PATCH 2/2] Update build_wheel.yml --- .github/workflows/build_wheel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index e2941b3ac6..16c2016c77 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -75,6 +75,7 @@ jobs: run: | git add VERSION git commit -m "Increment version to ${{ steps.do_version_increment.outputs.new_version }}" + git pull --rebase git push # Step 6: Update the git hash in the repository @@ -83,6 +84,7 @@ jobs: python3 get_git_version.py > git_commit_hash.txt git add git_commit_hash.txt git commit -m "Updated git_commit_hash.txt" + git pull --rebase git push # Step 7: Install required dependencies