-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (40 loc) · 1.91 KB
/
central-contract-repo-report.yaml
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
46
name: Specmatic Insights Central Contract Repo Report
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Generate central contract repo report
run: |
docker run -v "$(pwd):/central-contract-repo:rw" \
--entrypoint /bin/sh znsio/specmatic \
-c "cd /central-contract-repo && java -jar /usr/src/app/specmatic.jar central-contract-repo-report"
- name: Check URL Redirect
run: |
curl -I -L -o /dev/null -s -w "%{http_code} %{url_effective}\n" https://insights.specmatic.in
- name: Run Specmatic Insights Github Build Reporter
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_API_ACCESS_TOKEN }}
run: |
api_url="https://api.github.com/repos/${{ github.repository }}/actions/workflows"
workflow_name="${{ github.workflow }}"
response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" $api_url)
workflow_id=$(echo "$response" | jq -r --arg workflow_name "$workflow_name" '.workflows[] | select(.name == $workflow_name) | .id')
echo "Workflow ID: $workflow_id" # Debug print
docker run \
-v ${{ github.workspace }}:/workspace \
znsio/specmatic-insights-github-build-reporter:latest \
--specmatic-insights-host https://insights.specmatic.io \
--specmatic-reports-dir /workspace/build/reports/specmatic \
--org-id ${{ secrets.SPECMATIC_ORG_ID }} \
--branch-ref ${{ github.ref }} \
--branch-name ${{ github.ref_name }} \
--build-definition-id "$workflow_id" \
--build-id ${{ github.run_id }} \
--repo-name ${{ github.event.repository.name }} \
--repo-id ${{ github.repository_id }} \
--repo-url ${{ github.event.repository.html_url }}