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

Failed download with 404 results in success rather than failure #60

Open
nealeu opened this issue Nov 29, 2023 · 0 comments
Open

Failed download with 404 results in success rather than failure #60

nealeu opened this issue Nov 29, 2023 · 0 comments

Comments

@nealeu
Copy link

nealeu commented Nov 29, 2023

When trying to download something that might not exist, and want to fallback to using if: failure() on the next step, the following expected result happens:

    at /opt/actions-runner/_work/_actions/dsaltares/fetch-gh-release-asset/master/dist/index.js:6356:25
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async main (/opt/actions-runner/_work/_actions/dsaltares/fetch-gh-release-asset/master/dist/index.js:13865:19) {
  status: 404,

but, the result of the step is recorded as success:

    - name: Fetch mongodump for {{ inputs.load-mongodump-release }}-${{ steps.current_branch.outputs.branch }}
      id: fetch-mongodump-branch
      if: ${{ inputs.load-mongodump-release }}
      continue-on-error: true # So that the overall job doesn't fail if we recover from this
      uses: dsaltares/fetch-gh-release-asset@master
      with:
        version: tags/${{ inputs.load-mongodump-release }}-${{ steps.current_branch.outputs.branch }}
        file: 'mongodump.zip'

    - name: log previous step conclusion
      if: ${{ inputs.load-mongodump-release }}
      shell: bash
      run: echo "conclusion=${{ steps.fetch-mongodump-branch.conclusion }}" >> $GITHUB_OUTPUT

This means that this step never happens because conclusion is success:

    - name: Fetch mongodump for {{ inputs.load-mongodump-release }}-main
      id: fetch-mongodump-main
      if: ${{ failure() && inputs.load-mongodump-release }}
      uses: dsaltares/fetch-gh-release-asset@master
      with:
        version: tags/${{ inputs.load-mongodump-release }}-main
        file: 'mongodump.zip'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant