diff --git a/.github/workflows/dogfood.yml b/.github/workflows/dogfood.yml index 261fa09c..4975a533 100644 --- a/.github/workflows/dogfood.yml +++ b/.github/workflows/dogfood.yml @@ -17,3 +17,17 @@ jobs: fetch-depth: 0 - name: Dogfooding Docker run: make dogfood-docker FROM="origin/${{ github.base_ref }}" + + binary: + name: Binary + runs-on: ubuntu-latest + steps: + - name: Checkout code. + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - name: Compile. + run: make release + - name: Check clean Git history. + run: RUST_LOG=trace ./target/x86_64-unknown-linux-musl/release/clean_git_history --verbose "origin/${{ github.base_ref }}" diff --git a/.github/workflows/git-history.yml b/.github/workflows/git-history.yml index 80b409fb..5d52eb65 100644 --- a/.github/workflows/git-history.yml +++ b/.github/workflows/git-history.yml @@ -18,4 +18,4 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: Check clean Git history. - run: clean_git_history "origin/${{ github.base_ref }}" + run: clean_git_history --verbose "origin/${{ github.base_ref }}" diff --git a/Makefile b/Makefile index caf11cdf..60a71b86 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,7 @@ publish-crate: .PHONY: dogfood-docker dogfood-docker: release docker build -t clean_git_history -f Dockerfile . - docker run $(DOCKER_RUN_WRITE_OPTS) clean_git_history --verbose $(FROM) + docker run $(DOCKER_RUN_OPTS) clean_git_history --verbose $(FROM) .PHONY: publish-docker publish-docker: release diff --git a/src/main.rs b/src/main.rs index ebaab67c..2bdffc5a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -54,6 +54,30 @@ fn main() { } fn run(arguments: Arguments) -> Result<()> { + // Debug: Dump git configuration to help diagnose ownership issues + debug!("Current working directory: {:?}", std::env::current_dir()); + debug!("USER environment variable: {:?}", std::env::var("USER")); + debug!("HOME environment variable: {:?}", std::env::var("HOME")); + + // Dump git config to see what safe directories are configured + if let Ok(output) = std::process::Command::new("git") + .args(&["config", "--list", "--show-origin"]) + .output() + { + debug!( + "Git config output:\n{}", + String::from_utf8_lossy(&output.stdout) + ); + if !output.stderr.is_empty() { + debug!( + "Git config stderr:\n{}", + String::from_utf8_lossy(&output.stderr) + ); + } + } else { + debug!("Failed to run git config command"); + } + let repository = Repository::open_from_env().context("Unable to open the Git repository.")?; let commits = Commits::from_git(&repository, arguments.from)?;