-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (37 loc) · 1.2 KB
/
comment.yml
File metadata and controls
45 lines (37 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: build
on:
issue_comment:
types: [created]
jobs:
build:
if: >
startsWith(github.event.comment.body, 'build')
&& startsWith(github.event.issue.pull_request.url, 'https://')
runs-on: ubuntu-latest
steps:
- name: print comment body
run: echo ${{ github.event.comment.body }}
- name: set body comments
run: |
set -eu
build_dir=$( cut -d ' ' -f 2 <<< '${{ github.event.comment.body }}' )
buckets=$( cut -d ' ' -f 3- <<< "${{ github.event.comment.body }}" )
echo $build_dir
echo $buckets
- name: 'Load PR Details'
id: load-pr
run: |
set -eu
resp=$(curl -sSf \
--url ${{ github.event.issue.pull_request.url }} \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json')
echo $resp
branch=$(jq -r '.head.ref' <<< "$resp")
echo "::set-output name=branch::$branch"
# - uses: actions/checkout@v2
# with:
# ref: ${{ github.event.client_payload.ref }}
# - name: cat repo file
# run: cat output.txt
# working-directory: ${{ github.event.client_payload.project }}