actions / checkout

Action for checking out a repo
https://github.com/features/actions
MIT License
5.67k stars 1.67k forks source link

Maybe an actions checkout bug while running self hosted runner on Windows Server #1762

Open tsukuha opened 2 months ago

tsukuha commented 2 months ago

Thanks for looking this issue. I found an error while running GitHub Actions' actions/checkout. I expected this error is an actions/checkout's bug, so I want to search about this error.

Reproductions

enviroments

actions yml

name: SAMPLE

on:
  push:
    branches:
      - main

jobs:
  check-bats-version:
    runs-on:
      group: SAMPLE
      labels: [JOB]
    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

error log

Run actions/checkout@v4
  with:
    repository: group/repo
    token: ***
    ssh-strict: true
    ssh-user: git
    persist-credentials: true
    clean: true
    sparse-checkout-cone-mode: true
    fetch-depth: 1
    fetch-tags: false
    show-progress: true
    lfs: false
    submodules: false
    set-safe-directory: true
Syncing repository: group/repo
Getting Git version info
  Working directory is 'C:\actions-runner\_work\repo\repo'
Deleting the contents of 'C:\actions-runner\_work\repo\repo'
The repository will be downloaded using the GitHub REST API
To create a local Git repository instead, add Git [2](https://github.com/group/repo/actions/runs/0000000000/job/00000000000#step:2:2).18 or higher to the PATH
Downloading the archive
Writing archive to disk
Extracting the archive
C:\Windows\System[3](https://github.com/group/repo/actions/runs/0000000000/job/00000000000#step:2:3)2\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; if ((Get-Command -Name Expand-Archive -Module Microsoft.PowerShell.Archive -ErrorAction Ignore)) { Expand-Archive -LiteralPath 'C:\actions-runner\_work\repo\repo\xxxxxxxxx-xxxx-[4](https://github.com/group/repo/actions/runs/0000000000/job/00000000000#step:2:4)xxx-xxxx-xxxxxxxxxxxx.zip' -DestinationPath 'C:\actions-runner\_work\repo\repo\xxxxxxxxx-xxxx-xxxx-x[5](https://github.com/group/repo/actions/runs/0000000000/job/00000000000#step:2:5)xx-xxxxxxxxxxxx' -Force } else {[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\actions-runner\_work\repo\repo\xxxxxxxxx-xxxx-484[6](https://github.com/group/repo/actions/runs/0000000000/job/00000000000#step:2:6)-xxxx-xxxxxxxxxxxx.zip', 'C:\actions-runner\_work\repo\repo\xxx[7](https://github.com/group/repo/actions/runs/0000000000/job/00000000000#step:2:7)xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', $true) }"
Cannot convert argument "entryNameEncoding", with value: "True", for "ExtractTo
Directory" to type "System.Text.Encoding": "Cannot convert value "True" to type
 "System.Text.Encoding". Error: "Invalid cast from 'System.Boolean' to 'System.
Text.Encoding'.""
At line:1 char:42[8](https://github.com/group/repo/actions/runs/0000000000/job/00000000000#step:2:8)
+ $ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Comp
res ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordE 
   xception
    + FullyQualifiedErrorId : MethodArgumentConversionInvalidCastArgument

Error: The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1

description

no reproductive actions/checkout@v4.1.4

shyyng commented 1 month ago

Hi , do you find any solution ?