name: Download TD Artifacts

description: Download artifacts from target_determination.yml

inputs:
  use-gha:
    description: If set to any value, use GHA to download the artifact. Otherwise use s3.
    required: false

runs:
  using: composite
  steps:
    - name: Download TD Artifacts from S3
      if: ${{ !inputs.use-gha }}
      uses: seemethere/download-artifact-s3@v4
      with:
        name: td_results

    - name: Download TD Artifacts from GHA
      if: inputs.use-gha
      uses: actions/download-artifact@v4
      with:
        name: td_results.json

    - name: Move artifacts to .additional_ci_files folder
      shell: bash
      run: |
        mkdir -p .additional_ci_files
        mv td_results.json .additional_ci_files/td_results.json || true
