Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in output from entrypoint.sh #170

Closed
wolf99 opened this issue Nov 4, 2022 · 4 comments
Closed

Errors in output from entrypoint.sh #170

wolf99 opened this issue Nov 4, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@wolf99
Copy link
Contributor

wolf99 commented Nov 4, 2022

I can see the following from Bash in the output from the action:

mkdir: cannot create directory ‘lychee’: File exists
/home/runner/work/_actions/lycheeverse/lychee-action/25f59e1bc8f12b314a1e[36](https://github.com/exercism/problem-specifications/actions/runs/3396200796/jobs/5646999010#step:3:39)6f825e00d13de2d80b/entrypoint.sh: line 33: lychee/out.md: Not a directory
/home/runner/work/_actions/lycheeverse/lychee-action/25f59e1bc8f12b314a1e366f825e00d13de2d80b/entrypoint.sh: line 36: lychee/out.md: Not a directory

A run where this happens: https://github.com/exercism/problem-specifications/actions/runs/3396200796/jobs/5646999010

The referenced file is the action entrypoint.sh.

I tried playing around with similar commands in my Bash shell (below) but everything worked fine there, so this may be something specific to running in a container and the file system present (or not present) there 🤷 .

My quick local test of the related Bash commands.
One thing different here that is shown in the error output above, is the workflow URL does not get the ID of course, so perhaps there is some issue there?

~/test❯ LYCHEE_TMP="tmp/lychee/out.md"
~/test❯ INPUT_OUTPUT="lychee/out.md"
~/test❯ GITHUB_WORKFLOW_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true"

~/test❯ mkdir -p "$(dirname $LYCHEE_TMP)"
~/test❯ echo $?
0

~/test❯ mkdir -p "$(dirname -- "${INPUT_OUTPUT}")"
~/test❯ echo $?
0

~/test❯ cat "${LYCHEE_TMP}" > "${INPUT_OUTPUT}"
~/test❯ echo $?
0

~/test❯ echo "[Full Github Actions output](${GITHUB_WORKFLOW_URL})" >> "${INPUT_OUTPUT}"
~/test❯ cat lychee/out.md
[Full Github Actions output](https://github.com//actions/runs/?check_suite_focus=true)
@mre
Copy link
Member

mre commented Nov 8, 2022

Interesting.
The Command before the error is

mkdir -p "$(dirname -- "${INPUT_OUTPUT}")"

and that fails, too, in your output

...
mkdir: cannot create directory ‘lychee’: File exists
/home/runner/work/_actions/lycheeverse/lychee-action/25f59e1bc8f12b314a1e366f825e00d13de2d80b/entrypoint.sh: line 33: lychee/out.md: Not a directory
/home/runner/work/_actions/lycheeverse/lychee-action/25f59e1bc8f12b314a1e366f825e00d13de2d80b/entrypoint.sh: line 36: lychee/out.md: Not a directory
...

The reason is that we download the lychee binary under the same name and it sits there in the directory
and when we try to create a folder containing the output (out path is lychee/out.md by default) it can't overwrite the binary file named lychee of course. 🙈

Sooo we should probably remove the lychee binary after installation.
Also we should rename the default output directory to something else. Maybe lychee-out or we just skip the output directory altogether.

@mre mre added the bug Something isn't working label Nov 8, 2022
@mre
Copy link
Member

mre commented Nov 9, 2022

Fixed that in master. Will go live with the next release.

@mre
Copy link
Member

mre commented Nov 9, 2022

#172

@mre
Copy link
Member

mre commented Nov 9, 2022

Closing this as (hopefully) resolved. 😊

@mre mre closed this as completed Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants