Skip to content

Commit 3418ce0

Browse files
committed
Create bitrise-trigger.yml
1 parent fb231d5 commit 3418ce0

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Trigger Bitrise build-apps-internal pipeline
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
trigger-bitrise-pipeline:
9+
# Only run for PR comments starting with /bitrise build
10+
if: |
11+
github.event.issue.pull_request &&
12+
startsWith(github.event.comment.body, '/bitrise build')
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Trigger Bitrise internal pipeline
16+
env:
17+
BITRISE_APP_SLUG: ${{ secrets.BITRISE_APP_SLUG }}
18+
BITRISE_TOKEN: ${{ secrets.BITRISE_TOKEN }}
19+
HEAD_REF: ${{ github.event.issue.pull_request.head.ref }}
20+
HEAD_REPO: ${{ github.event.issue.pull_request.head.repo.full_name }}
21+
COMMIT_SHA: ${{ github.event.issue.pull_request.head.sha }}
22+
COMMENT_BODY: ${{ github.event.comment.body }}
23+
run: |
24+
echo "Triggering Bitrise pipeline: build-apps-internal"
25+
curl -X POST "https://api.bitrise.io/v0.1/apps/${BITRISE_APP_SLUG}/pipelines" \
26+
-H "Authorization: ${BITRISE_TOKEN}" \
27+
-H "Content-Type: application/json" \
28+
-d '{
29+
"pipeline_id": "build-apps-internal",
30+
"build_params": {
31+
"branch": "'"${HEAD_REF}"'",
32+
"commit_hash": "'"${COMMIT_SHA}"'",
33+
"commit_message": "Triggered from GitHub comment: '${COMMENT_BODY}'",
34+
"pull_request_repository_url": "https://github.com/'"${HEAD_REPO}"'"
35+
},
36+
"triggered_by": "GitHub Action PR comment"
37+
}'

0 commit comments

Comments
 (0)