Github Actions — checkout error

Jane
1 min readAug 2, 2021

--

When running this action to pull current branch code line into runner

- uses: actions/checkout@v2

Reference : https://github.com/marketplace/actions/checkout#Fetch-all-history-for-all-tags-and-branches

sometimes will pop-up this error message

Error: error: insufficient permission for adding an object to repository database .git/objects87 Error: fatal: failed to write object88 Error: fatal: unpack-objects failed

I find some ways to figure out the problem

  1. add AutoModality/action-clean@v1
    Reference: https://github.com/marketplace/actions/clean-workspace
  2. using another branch to trigger this event
  3. Somebody mentioned…
- uses: actions/checkout@v2
with:
lfs: true
token: ${{ secrets.ACCESS_TOKEN }}

4. Waiting for 10 second then checkout
Reference : https://github.com/actions/checkout/issues/417#issuecomment-842157976)

Finally, the methods 1 and 4 can figure out this problem

Example code…

steps: - name: clean workspace   uses: AutoModality/action-clean@v1 - name: sleep 10 sec   run: sleep 10 - uses: actions/checkout@v2

— — — — Aug 3 update — — — —

I mentioned methods 1 and 4 can’t figure out this problem….

— — — — Aug 6 update — — — —

Because I using aws ec2 as self-host

the runner workspace folder role different

then I add following command to figure this problem

# sync folder owner- name: sync owner  run: sudo chown runner:runner -R .*

--

--