Skip to content

feat: auto-trigger code sample testing #7

feat: auto-trigger code sample testing

feat: auto-trigger code sample testing #7

name: Test API Docs Code Samples
on:
push:
paths:
- 'apify-api/openapi/code_samples/**'
pull_request:
paths:
- 'apify-api/openapi/code_samples/**'
jobs:
run-code-sample-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get current branch name
id: get-branch-name
run: echo "branch_name=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
- name: Call Code Sample Tester Actor
env:
APIFY_TOKEN: ${{ secrets.CODE_SAMPLE_TESTER_ACTOR_TOKEN }}
BRANCH_NAME: ${{ env.branch_name }}
run: |
curl -X POST "https://api.apify.com/v2/acts/X8D0L4wfpO8fCL1uL/run-sync" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-d '{ "branch": "'"$BRANCH_NAME"'" }'