name: Checkout description: Clone repository with configurable depth inputs: repository: description: Repository to clone (owner/repo) default: ${{ github.repository }} ref: description: Branch, tag, or SHA to checkout default: ${{ github.ref_name }} depth: description: Clone depth (0 for full history) default: '1' token: description: Token for private repositories default: ${{ github.token }} runs: using: composite steps: - shell: bash run: | URL="https://oauth2:${{ inputs.token }}@git.flowmade.one/${{ inputs.repository }}.git" clone() { if [ "${{ inputs.depth }}" = "0" ]; then git clone "$URL" . else git clone --depth "${{ inputs.depth }}" --branch "${{ inputs.ref }}" "$URL" . fi } # Runner egress is flaky (transient DNS/connection failures to the git # server); retry with backoff before failing the job. ok=0 for attempt in 1 2 3; do if clone; then ok=1 break fi if [ "$attempt" -eq 3 ]; then break fi echo "clone failed, retrying in $((attempt * 10))s..." sleep $((attempt * 10)) done [ "$ok" -eq 1 ] || exit 1