diff --git a/.github/workflows/ci-master-failure-chack-agent-pr.yml b/.github/workflows/ci-master-failure-chack-agent-pr.yml index d51b23d..da496c0 100644 --- a/.github/workflows/ci-master-failure-chack-agent-pr.yml +++ b/.github/workflows/ci-master-failure-chack-agent-pr.yml @@ -127,8 +127,13 @@ jobs: # Avoid workflow-file pushes with token scopes that cannot write workflows. git reset -- .github/workflows || true git checkout -- .github/workflows || true - git clean -fd -- .github/workflows || true + git clean -fdx -- .github/workflows || true git reset -- chack_failure_summary.txt chack_prompt.txt chack_failed_steps_logs.txt + if git diff --cached --name-only | grep -q '^.github/workflows/'; then + echo "Workflow-file changes are still staged; skipping push without workflows permission." + echo "pushed=false" >> "$GITHUB_OUTPUT" + exit 0 + fi if git diff --cached --quiet; then echo "No committable changes left after filtering." echo "pushed=false" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/pr-failure-chack-agent-dispatch.yml b/.github/workflows/pr-failure-chack-agent-dispatch.yml index 6555a9b..e2eecb7 100644 --- a/.github/workflows/pr-failure-chack-agent-dispatch.yml +++ b/.github/workflows/pr-failure-chack-agent-dispatch.yml @@ -184,8 +184,12 @@ jobs: # Avoid workflow-file pushes with token scopes that cannot write workflows. git reset -- .github/workflows || true git checkout -- .github/workflows || true - git clean -fd -- .github/workflows || true + git clean -fdx -- .github/workflows || true git reset -- chack_failure_summary.txt chack_prompt.txt + if git diff --cached --name-only | grep -q '^.github/workflows/'; then + echo "Workflow-file changes are still staged; skipping push without workflows permission." + exit 0 + fi if git diff --cached --quiet; then echo "No committable changes left after filtering." exit 0