Skip to content

Commit 27f5c8f

Browse files
authored
Use random tempfile for LYCHEE_TMP (#173)
* Use random tempfile for `LYCHEE_TMP` This prevents output overlapping when running lychee multiple times. Note that the final output file remains unchanged. This is on purpose because when executing lychee multiple times within the same workflow, the output of all runs will be concatenated. To prevent that you can set a different output path for both runs: ```yaml - uses: lycheeverse/lychee-action@master with: args: '<some args> -- <file1>' output: run1.md fail: true jobSummary: true - uses: lycheeverse/lychee-action@master with: args: '<some args> -- <file2>' output: run2.md fail: true jobSummary: true ``` * Remove unnecessary call to create temp dir mktemp makes sure it exists
1 parent 4dcb8be commit 27f5c8f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

entrypoint.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ if [ "${INPUT_DEBUG}" = true ]; then
77
set -x
88
fi
99

10-
LYCHEE_TMP="/tmp/lychee/out.md"
10+
LYCHEE_TMP="$(mktemp)"
1111
GITHUB_WORKFLOW_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true"
1212

13-
# Create temp dir
14-
mkdir -p "$(dirname $LYCHEE_TMP)"
15-
1613
ARGS="${INPUT_ARGS}"
1714
FORMAT=""
1815
# Backwards compatibility:

0 commit comments

Comments
 (0)