Skip to content

Commit

Permalink
Use random tempfile for LYCHEE_TMP (#173)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mre committed Nov 10, 2022
1 parent 4dcb8be commit 27f5c8f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ if [ "${INPUT_DEBUG}" = true ]; then
set -x
fi

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

# Create temp dir
mkdir -p "$(dirname $LYCHEE_TMP)"

ARGS="${INPUT_ARGS}"
FORMAT=""
# Backwards compatibility:
Expand Down

0 comments on commit 27f5c8f

Please sign in to comment.