Skip to content

Commit dc8dd57

Browse files
committed
feat: auto-trigger code sample testing
1 parent 54fe91e commit dc8dd57

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# When some files in the code_samples folder change, we want to run an Apify Actor and pass it the branch name, if possible, so it can test the samples
2+
name: Test Code Samples
3+
4+
on:
5+
push:
6+
paths:
7+
- 'apify-api/openapi/code_samples/**'
8+
pull_request:
9+
paths:
10+
- 'apify-api/openapi/code_samples/**'
11+
12+
jobs:
13+
call-apify-actor:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
20+
- name: Get current branch name
21+
id: get-branch-name
22+
run: echo "branch_name=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
23+
24+
- name: Call Code Sample Tester Actor
25+
env:
26+
APIFY_TOKEN: ${{ secrets.APIFY_TOKEN }}
27+
BRANCH_NAME: ${{ env.branch_name }}
28+
run: |
29+
curl -X POST "https://api.apify.com/v2/actors/X8D0L4wfpO8fCL1uL/runs" \
30+
-H "Content-Type: application/json" \
31+
-H "Authorization: Bearer $APIFY_TOKEN" \
32+
-d '{
33+
"input": {
34+
"branchName": "'"$BRANCH_NAME"'"
35+
}
36+
}'

0 commit comments

Comments
 (0)