name: 'Non-Bazel Bash Run'
description: 'Run a bash script for Protobuf CI testing with a non-Bazel build system'
inputs:
  credentials:
    required: true
    description: "The GCP credentials to use for reading the docker image"
    type: string
  command:
    required: true
    description: A command to run in the docker image

runs:
  using: 'composite'
  steps:
    - name: Setup Runner
      uses: ./.github/actions/internal/setup-runner

    - name: Update stale files using Bazel
      uses: ./.github/actions/bazel
      with:
        credentials: ${{ inputs.credentials }}
        bazel-cache: regenerate-stale-files
        bash: ./regenerate_stale_files.sh $BAZEL_FLAGS

    - name: Run
      shell: bash
      run: ${{ inputs.command }}
