name: Add backport table to PR on: pull_request_target: types: - closed branches: - main workflow_dispatch: inputs: pr_number: description: 'Pull Request number to add backport table to' required: true type: number permissions: contents: read pull-requests: write env: GH_TOKEN: ${{ secrets.YDBOT_TOKEN }} jobs: add-backport-table: name: Add backport table to merged PR runs-on: [ self-hosted, auto-provisioned, build-preset-analytic-node] if: > ( github.event_name == 'workflow_dispatch' ) || ( github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && vars.SHOW_BACKPORT_IN_PR == 'TRUE' ) steps: - name: Checkout repository uses: actions/checkout@v5 with: ref: ${{ github.event_name == 'workflow_dispatch' && github.ref || 'main' }} fetch-depth: 1 sparse-checkout: | .github - name: Install dependencies run: | python3 -m pip install --upgrade pip pip install PyGithub - name: Add backport table to PR env: GITHUB_TOKEN: ${{ env.GH_TOKEN }} GITHUB_EVENT_PATH: ${{ github.event_path }} GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_WORKSPACE: ${{ github.workspace }} APP_DOMAIN: ${{ vars.APP_DOMAIN }} SHOW_BACKPORT_IN_PR: ${{ vars.SHOW_BACKPORT_IN_PR }} PR_NUMBER: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_number || '' }} run: | python3 ./.github/scripts/add_backport_table.py