diff --git a/action.yml b/action.yml index 5669f66..92d7593 100644 --- a/action.yml +++ b/action.yml @@ -23,7 +23,7 @@ inputs: rat-version: description: | Apache Creadur RAT Version - See Apache archives for available versions. + See Apache dlcdn or archives for available versions. e.g. 0.15, 0.14, ... required: false default: 0.16.1 @@ -42,7 +42,21 @@ runs: shell: bash working-directory: ${{ github.action_path }} run: | - curl --no-progress-meter https://archive.apache.org/dist/creadur/apache-rat-${{ inputs.rat-version }}/apache-rat-${{ inputs.rat-version }}-bin.tar.gz --output apache-rat-${{ inputs.rat-version }}-bin.tar.gz + set +e + # Try Apache's Download CDN + echo "Attempting to download from Apache's Download CDN" + curl --fail --silent --no-progress-meter https://dlcdn.apache.org/creadur/apache-rat-${{ inputs.rat-version }}/apache-rat-${{ inputs.rat-version }}-bin.tar.gz --output apache-rat-${{ inputs.rat-version }}-bin.tar.gz + + if [ $? -ne 0 ]; then + # It is possible that a new version was released and last version removed from dlcdn. + echo "Attempting to download from Apache's Archive" + curl --no-progress-meter https://archive.apache.org/dist/creadur/apache-rat-${{ inputs.rat-version }}/apache-rat-${{ inputs.rat-version }}-bin.tar.gz --output apache-rat-${{ inputs.rat-version }}-bin.tar.gz + + if [ $? -ne 0 ]; then + echo "Failed to download Apache RAT" + exit 1 + fi + fi tar zxf apache-rat-${{ inputs.rat-version }}-bin.tar.gz - name: Run Apache Creadur RAT with ratignore