[PR #595] [MERGED] Clean the repository cache if it is in incomplete state #1513

Closed
opened 2026-03-01 21:51:30 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/595
Author: @lufia
Created: 4/2/2021
Status: Merged
Merged: 4/6/2021
Merged by: @cplee

Base: masterHead: wait-to-cleanup


📝 Commits (2)

  • 56398d1 Clean the repository cache if it is in incomplete state
  • 5766f14 Merge branch 'master' into wait-to-cleanup

📊 Changes

3 files changed (+49 additions, -11 deletions)

View changed files

📝 pkg/common/executor.go (+8 -8)
📝 pkg/common/executor_test.go (+38 -0)
📝 pkg/common/git.go (+3 -3)

📄 Description

Go-git v5 has PlainCloneContext. It accepts a context.Context at first argument then it cleanup the directory if any error is occurred in cloning the repository.

ref https://github.com/nektos/act/issues/538#issuecomment-807917882

Seems like this issue occurs when actions cache gets corrupted.

Tests

I've tested with a workflow described in https://github.com/nektos/act/issues/538#issue-812434528

% act -n workflow_dispatch
*DRYRUN* [java-test/build] 🚀  Start image=catthehacker/ubuntu:act-latest
*DRYRUN* [java-test/build]   🐳  docker run image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
*DRYRUN* [java-test/build] ⭐  Run Set up JDK 1.11
*DRYRUN* [java-test/build]   ☁  git clone 'https://github.com/actions/setup-java' # ref=v1
// Interrupt here
^C*DRYRUN* [java-test/build] Unable to clone https://github.com/actions/setup-java refs/heads/v1: context canceled
*DRYRUN* [java-test/build]   ❌  Failure - Set up JDK 1.11
Error: context canceled

% act -n workflow_dispatch
*DRYRUN* [java-test/build] 🚀  Start image=catthehacker/ubuntu:act-latest
*DRYRUN* [java-test/build]   🐳  docker run image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
*DRYRUN* [java-test/build] ⭐  Run Set up JDK 1.11
*DRYRUN* [java-test/build]   ☁  git clone 'https://github.com/actions/setup-java' # ref=v1
*DRYRUN* [java-test/build]   ✅  Success - Set up JDK 1.11

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/595 **Author:** [@lufia](https://github.com/lufia) **Created:** 4/2/2021 **Status:** ✅ Merged **Merged:** 4/6/2021 **Merged by:** [@cplee](https://github.com/cplee) **Base:** `master` ← **Head:** `wait-to-cleanup` --- ### 📝 Commits (2) - [`56398d1`](https://github.com/nektos/act/commit/56398d1c823135a1c529f6b33a588d288535a5ed) Clean the repository cache if it is in incomplete state - [`5766f14`](https://github.com/nektos/act/commit/5766f14b90ad43beb7d654bb71dfe9bd82723a3c) Merge branch 'master' into wait-to-cleanup ### 📊 Changes **3 files changed** (+49 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `pkg/common/executor.go` (+8 -8) 📝 `pkg/common/executor_test.go` (+38 -0) 📝 `pkg/common/git.go` (+3 -3) </details> ### 📄 Description Go-git v5 has [PlainCloneContext](https://pkg.go.dev/github.com/go-git/go-git/v5#PlainCloneContext). It accepts a `context.Context` at first argument then it cleanup the directory if any error is occurred in cloning the repository. ref https://github.com/nektos/act/issues/538#issuecomment-807917882 > Seems like this issue occurs when actions cache gets corrupted. ### Tests I've tested with a workflow described in https://github.com/nektos/act/issues/538#issue-812434528 ```console % act -n workflow_dispatch *DRYRUN* [java-test/build] 🚀 Start image=catthehacker/ubuntu:act-latest *DRYRUN* [java-test/build] 🐳 docker run image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] *DRYRUN* [java-test/build] ⭐ Run Set up JDK 1.11 *DRYRUN* [java-test/build] ☁ git clone 'https://github.com/actions/setup-java' # ref=v1 // Interrupt here ^C*DRYRUN* [java-test/build] Unable to clone https://github.com/actions/setup-java refs/heads/v1: context canceled *DRYRUN* [java-test/build] ❌ Failure - Set up JDK 1.11 Error: context canceled % act -n workflow_dispatch *DRYRUN* [java-test/build] 🚀 Start image=catthehacker/ubuntu:act-latest *DRYRUN* [java-test/build] 🐳 docker run image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] *DRYRUN* [java-test/build] ⭐ Run Set up JDK 1.11 *DRYRUN* [java-test/build] ☁ git clone 'https://github.com/actions/setup-java' # ref=v1 *DRYRUN* [java-test/build] ✅ Success - Set up JDK 1.11 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-01 21:51:30 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1513
No description provided.