From daa71d1655f4069510f56b5b409485217875e9b3 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 12 Aug 2024 13:32:24 +0200 Subject: [PATCH] DRY up the lengthy `.tar` file name The name of the `.tar` file is repeated multiple times, verbatim. This not only violates the Don't Repeat Yourself (DRY) principle, it also makes it easier to miss an instance when the file name changes (as it did with https://github.com/lycheeverse/lychee/pull/1464). Signed-off-by: Johannes Schindelin --- action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 2273afb..9531287 100644 --- a/action.yml +++ b/action.yml @@ -48,9 +48,10 @@ runs: run: | # Cleanup artifacts from previous run in case it crashed rm -rf "lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz" lychee - curl -sfLO "https://github.com/lycheeverse/lychee/releases/download/${{ inputs.LYCHEEVERSION }}/lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz" - tar -xvzf "lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz" - rm "lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz" + filename='lychee-${{ inputs.LYCHEEVERSION }}-x86_64-unknown-linux-gnu.tar.gz' + curl -sfLO "https://github.com/lycheeverse/lychee/releases/download/${{ inputs.LYCHEEVERSION }}/$filename" + tar -xvzf "$filename" + rm "$filename" install -t "$HOME/.local/bin" -D lychee rm lychee echo "$HOME/.local/bin" >> "$GITHUB_PATH"