Merge pull request #24 from znsio/graphql_scalar #70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.io | |
- 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 }} |