Skip to content

2.4 Fix CircleCI nightly-twice-a-week workflow #561

2.4 Fix CircleCI nightly-twice-a-week workflow

2.4 Fix CircleCI nightly-twice-a-week workflow #561

name: Check if needs trigger CircleCI benchmark
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
jobs:
haslabel:
name: analyse labels
runs-on: ubuntu-latest
outputs:
benchmark: ${{ steps.haslabel.outputs.labeled-run-benchmark }}
steps:
- uses: actions/checkout@v2
- name: Labeled with run-benchmark
id: haslabel
uses: DanielTamkin/HasLabel@v1.0.4
with:
contains: 'run-benchmark'
perf-ci:
name: Trigger CI benchmarks
needs: haslabel
if: needs.haslabel.outputs.benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: curl-circle-ci
run: |
curl --request POST \
--url https://circleci.com/api/v2/project/gh/${{ github.repository }}/pipeline \
--header 'Circle-Token: ${{ secrets.CIRCLE_CI_SECRET }}' \
--header 'content-type: application/json' \
--data '{"branch": "${{ github.event.pull_request.head.ref }}",
"parameters": {"run_default_flow":true, "run_benchmark_flow_label":true}}'