editorconfig-checker / action-editorconfig-checker

MIT License
20 stars 5 forks source link

Does not work on self-hosted runner #129

Open rskmm0chang opened 2 days ago

rskmm0chang commented 2 days ago

This action deploys necessary commands to $HOME/bin/(https://github.com/editorconfig-checker/action-editorconfig-checker/blob/main/src/index.ts#L14), but the official image for self-hosted runner already has files placed in $HOME/bin/, causing unexpected behavior.

 % docker run -it ghcr.io/actions/actions-runner:2.319.1  /bin/sh
.
.
$ ls -l $HOME/bin
total 84736
-rwxr--r-- 1 runner docker   392736 Nov 10  2023 Azure.Core.dll
-rwxr--r-- 1 runner docker  1308080 Nov 13  2023 Azure.Storage.Blobs.dll
.
.
-rw-r--r-- 1 runner docker     5937 Aug 13 16:29 update.cmd.template
-rwxr-xr-x 1 runner docker     8748 Aug 13 16:29 update.sh.template

log:

Run editorconfig-checker/action-editorconfig-checker@v2.0.0
Find 'latest' release
Downloading 'ec-linux-arm[6](https://github.com/XXXX/XXXX/actions/runs/XXXX/job/XXXX?pr=148#step:3:7)4.tar.gz'
Extracting 'ec-linux-arm64.tar.gz'
/usr/bin/tar xz --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/_work/_temp/3c943f84-60[7](https://github.com/XXXX/XXXX/actions/runs/XXXX/job/XXXX?pr=148#step:3:8)d-4cd9-86d3-b2f97b15fc25
Rename 'Azure.Core.dll' to 'editorconfig-checker.dll'
Add to PATH
mstruebing commented 2 hours ago

I suspect these are the bugged lines: https://github.com/editorconfig-checker/action-editorconfig-checker/blob/main/src/index.ts#L15-L20

We just take the first file readdir returns without checking anything.

We should either make this more robust by looking for the correct files or create a specific directory which we use to work on.