# Trigger the Pre-Release tests
#
# Params:
#   ref: branch, tag or SHA to checkout, defaults to `main`
# 
name: Trigger Pre-Release tests
on:
  workflow_dispatch:
    inputs:
      ref:
        description: "branch, tag or SHA to checkout"
        required: true
        default: "main"

jobs:
  trigger_tests:
    runs-on: ubuntu-latest
    steps:

    - name: Checkout TimescaleDB
      uses: actions/checkout@v4
      with: 
        ref: ${{ github.event.inputs.ref }}
        token: ${{ secrets.ORG_AUTOMATION_TOKEN }}
    
    - name: Push to pre-release branch
      env:
        GH_TOKEN: ${{ secrets.ORG_AUTOMATION_TOKEN }}
      run: |
        git push origin HEAD:prerelease_test --force
