From a5a6ca13c2877e48e5bd9d7c15a9f39fdaa69d1f Mon Sep 17 00:00:00 2001 From: Lee Dogeon Date: Mon, 12 Jan 2026 03:26:05 +0900 Subject: [PATCH 1/2] Clarify commit message from pr-auto-commit --- .github/workflows/pr-auto-commit.yaml | 58 ++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr-auto-commit.yaml b/.github/workflows/pr-auto-commit.yaml index 203a42a61fe..d0537c00efa 100644 --- a/.github/workflows/pr-auto-commit.yaml +++ b/.github/workflows/pr-auto-commit.yaml @@ -34,10 +34,21 @@ jobs: with: components: rustfmt + - name: Configure git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + echo "" > /tmp/committed_commands.txt + - name: Run cargo fmt run: | echo "Running cargo fmt --all on PR #${{ github.event.pull_request.number }}" cargo fmt --all + if [ -n "$(git status --porcelain)" ]; then + git add -u + git commit -m "Auto-format: cargo fmt --all" + echo "- \`cargo fmt --all\`" >> /tmp/committed_commands.txt + fi - name: Install ruff uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1 @@ -45,31 +56,55 @@ jobs: version: "0.14.9" args: "--version" - - run: ruff format - - run: ruff check --select I --fix - - run: python scripts/generate_opcode_metadata.py + - name: Run ruff format + run: | + ruff format + if [ -n "$(git status --porcelain)" ]; then + git add -u + git commit -m "Auto-format: ruff format" + echo "- \`ruff format\`" >> /tmp/committed_commands.txt + fi - - name: Configure git + - name: Run ruff check import sorting run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" + ruff check --select I --fix + if [ -n "$(git status --porcelain)" ]; then + git add -u + git commit -m "Auto-format: ruff check --select I --fix" + echo "- \`ruff check --select I --fix\`" >> /tmp/committed_commands.txt + fi + + - name: Run generate_opcode_metadata.py + run: | + python scripts/generate_opcode_metadata.py + if [ -n "$(git status --porcelain)" ]; then + git add -u + git commit -m "Auto-generate: generate_opcode_metadata.py" + echo "- \`python scripts/generate_opcode_metadata.py\`" >> /tmp/committed_commands.txt + fi - name: Check for changes id: check-changes run: | - if [ -n "$(git status --porcelain)" ]; then + if [ "$(git rev-parse HEAD)" != "${{ github.event.pull_request.head.sha }}" ]; then echo "has_changes=true" >> $GITHUB_OUTPUT else echo "has_changes=false" >> $GITHUB_OUTPUT fi - - name: Commit and push formatting changes + - name: Push formatting changes if: steps.check-changes.outputs.has_changes == 'true' run: | - git add -u - git commit -m "Auto-format: cargo fmt --all" git push origin HEAD:${{ github.event.pull_request.head.ref }} + - name: Read committed commands + id: committed-commands + if: steps.check-changes.outputs.has_changes == 'true' + run: | + echo "list<> $GITHUB_OUTPUT + cat /tmp/committed_commands.txt >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: Comment on PR if: steps.check-changes.outputs.has_changes == 'true' uses: marocchino/sticky-pull-request-comment@v2 @@ -78,7 +113,8 @@ jobs: message: | **Code has been automatically formatted** - The code in this PR has been formatted using `cargo fmt --all`. + The code in this PR has been formatted using: + ${{ steps.committed-commands.outputs.list }} Please pull the latest changes before pushing again: ```bash git pull origin ${{ github.event.pull_request.head.ref }} From 0ec2addd404c340afbdcb66979d079ea9845cf83 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 11 Jan 2026 19:19:12 +0000 Subject: [PATCH 2/2] Auto-format: cargo fmt --all --- scripts/fix_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fix_test.py b/scripts/fix_test.py index 4b3e0bfddda..0970531f079 100644 --- a/scripts/fix_test.py +++ b/scripts/fix_test.py @@ -27,7 +27,7 @@ import sys from pathlib import Path -from lib_updater import apply_patches, PatchSpec, UtMethod +from lib_updater import PatchSpec, UtMethod, apply_patches def parse_args():