name: CI_METAX

on:
  pull_request_target:
    types:
      - opened
      - synchronize
    branches:
      - develop
      - release/**

permissions:
  contents: read

concurrency:
  group: jenkins-pr-${{ github.event.pull_request.number }}
  cancel-in-progress: true

jobs:
  trigger-jenkins:
    name: Trigger Jenkins for PR
    runs-on: ubuntu-latest
    environment: Metax_ci

    steps:
      - name: Trigger Jenkins job
        timeout-minutes: 120
        uses: MetaX-MACA/simple-jenkins-githubaction@v1.1
        with:
          job_name: paddle_fastdeploy_metax_smoketest
          username: fastdeploy_builder
          api_token: ${{ secrets.METAX_JENKINS_API_TOKEN }}
          pr_number: ${{ github.event.pull_request.number }}
          project_branch: ${{ github.event.pull_request.base.ref }}
