-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (39 loc) · 1.36 KB
/
diff.yml
File metadata and controls
45 lines (39 loc) · 1.36 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: Diff
on:
pull_request: {}
jobs:
render-diff:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Wait on Workflow
uses: lucasssvaz/wait-on-workflow@v1
with:
workflow: pr.yml
max-wait: 3
timeout: 60
sha: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ steps.extract_branch.outputs.branch }}
- name: Run make generate
run: make generate-with-diff-check
- name: Trigger diff on internal gitlab
id: trigger_diff
run: |
response=$(curl -X POST \
--fail \
-F token=${{ secrets.GITLAB_CI_TOKEN }} \
-F ref=main \
-F "variables[BRANCH]=${{ steps.extract_branch.outputs.branch }}" \
https://git.vshn.net/api/v4/projects/58084/trigger/pipeline | jq .web_url)
echo "response=$response" >> $GITHUB_OUTPUT
- name: Comment on PR
run: |
gh pr comment --body "- [ ] Check out Your new Comp-Functions diff at: ${{ steps.trigger_diff.outputs.response }}"