Skip to content

CML v0.20.3

CML v0.20.3 #876

name: Trigger external examples & test
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to pass with repository_dispatch ex: "v0.15.1"'
type: string
required: true
release:
types: [published]
pull_request_target:
branches: [main]
push:
branches: [main]
jobs:
push:
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
runs-on: ubuntu-latest
strategy:
matrix:
repos: [cml-playground]
steps:
- name: Trigger external actions
run: |
curl --silent --show-error --request POST \
--header "Authorization: token ${{ secrets.TEST_GITHUB_TOKEN }}" \
--header "Accept: application/vnd.github.v3+json" \
--url "https://api.github.com/repos/iterative/${{ matrix.repos }}/dispatches" \
--data '{"event_type":"push", "client_payload": {"branch":"main"}}'
pr:
if: ${{ github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
strategy:
matrix:
repos: [cml-playground]
steps:
- name: Trigger external actions
run: |
curl --silent --show-error --request POST \
--header "Authorization: token ${{ secrets.TEST_GITHUB_TOKEN }}" \
--header "Accept: application/vnd.github.v3+json" \
--url "https://api.github.com/repos/iterative/${{ matrix.repos }}/dispatches" \
--data '{"event_type":"pr", "client_payload": {"branch":"${{ github.ref_name }}"}}'
trigger:
if:
${{ github.event_name == 'release' || github.event_name ==
'workflow_dispatch' }}
runs-on: ubuntu-latest
strategy:
matrix:
repos: [cml-playground]
steps:
- name: Trigger external actions
run: |
curl --silent --show-error --request POST \
--header "Authorization: token ${{ secrets.TEST_GITHUB_TOKEN }}" \
--header "Accept: application/vnd.github.v3+json" \
--url "https://api.github.com/repos/iterative/${{ matrix.repos }}/dispatches" \
--data '{"event_type":"new-cml", "client_payload": {"tag":"${{ github.event.release.tag_name || github.event.inputs.tag }}"}}'