Skip to content

Commit 52d2d27

Browse files
committed
tech: use a Github Action to trigger CircleCI
This will let us trigger build-and-test workflow on pull request only See https://circleci.com/blog/trigger-circleci-pipeline-github-action/
1 parent 89338d0 commit 52d2d27

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.circleci/config.yml

+18
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@
2121

2222
version: 2.1
2323

24+
parameters:
25+
GHA_Actor:
26+
type: string
27+
default: ""
28+
GHA_Action:
29+
type: string
30+
default: ""
31+
GHA_Event:
32+
type: string
33+
default: ""
34+
GHA_Meta:
35+
type: string
36+
default: ""
37+
2438
orbs:
2539
browser-tools: circleci/browser-tools@1.4.8
2640

@@ -93,6 +107,10 @@ executors:
93107
workflows:
94108
version: 2
95109
build-and-test:
110+
# This workflow is set to be conditionally triggered, only when
111+
# the GitHub Action is triggered.
112+
# With no other workflows, normal push events will be ignored currently.
113+
when: << pipeline.parameters.GHA_Action >>
96114
jobs:
97115
- checkout:
98116
context: Pix

.github/workflows/main.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Trigger CircleCI
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened]
6+
7+
jobs:
8+
trigger-ci:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Trigger CircleCI
13+
uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5
14+
env:
15+
CCI_TOKEN: ${{ secrets.PIX_SERVICE_CIRCLE_CI_TOKEN }}

0 commit comments

Comments
 (0)