{"id":21528230,"url":"https://github.com/znsio/specmatic-insights-github-build-reporter","last_synced_at":"2025-03-17T18:44:44.510Z","repository":{"id":240019095,"uuid":"799906022","full_name":"znsio/specmatic-insights-github-build-reporter","owner":"znsio","description":"Specmatic Insights Github Build Reporter","archived":false,"fork":false,"pushed_at":"2024-07-19T19:07:45.000Z","size":131,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-24T06:09:35.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/znsio.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-13T10:31:29.000Z","updated_at":"2024-07-19T19:07:48.000Z","dependencies_parsed_at":"2024-05-16T09:56:37.547Z","dependency_job_id":"3f5c13be-d405-45c1-a808-884b312477a9","html_url":"https://github.com/znsio/specmatic-insights-github-build-reporter","commit_stats":null,"previous_names":["znsio/specmatic-insights-github-build-reporter"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2Fspecmatic-insights-github-build-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2Fspecmatic-insights-github-build-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2Fspecmatic-insights-github-build-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2Fspecmatic-insights-github-build-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/znsio","download_url":"https://codeload.github.com/znsio/specmatic-insights-github-build-reporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244091738,"owners_count":20396664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T01:52:17.774Z","updated_at":"2025-03-17T18:44:44.491Z","avatar_url":"https://github.com/znsio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Specmatic Insights Github Build Reporter\n\nThis package runs as part of your CI pipeline to ship [Specmatic](https://specmatic.io/) reports to [Specmatic Insights](https://insights.specmatic.io/).\n\nPlease contact [Specmatic team](https://specmatic.io/contact-us/) for more info.\n\n## Fetching the Workflow Definition ID\n```yaml\n- name: Get Workflow Definition ID\n  id: get_workflow_id\n  env:\n    GITHUB_TOKEN: ${{ secrets.GITHUB_ACCESS_TOKEN }}\n  run: |\n    api_url=\"https://api.github.com/repos/${{ github.repository }}/actions/workflows\"\n    workflow_name=\"${{ github.workflow }}\"\n    response=$(curl -s -H \"Authorization: token $GITHUB_TOKEN\" $api_url)\n    workflow_id=$(echo \"$response\" | jq -r --arg workflow_name \"$workflow_name\" '.workflows[] | select(.name == $workflow_name) | .id')\n    echo \"Workflow ID: $workflow_id\" # Debug print\n    echo \"workflow_id=$workflow_id\" \u003e\u003e \"$GITHUB_OUTPUT\"\n```\nNote:\n  - The workflow ID is used to send the build report to Specmatic Insights.\n  - Please set up `GITHUB_ACCESS_TOKEN` as a fine grained personal access token with `Read access to actions and metadata` for `Repository permissions`. More details [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).\n\n## Docker Usage in GitHub Actions\n```yaml\n- name: Run Specmatic Insights Github Build Reporter\n  run: |\n    docker run \\\n      -v ${{ github.workspace }}:/workspace \\\n      znsio/specmatic-insights-github-build-reporter:latest \\\n        --specmatic-insights-host https://insights.specmatic.io \\\n        --specmatic-reports-dir /workspace/build/reports/specmatic \\\n        --org-id ${{ secrets.SPECMATIC_ORG_ID }} \\\n        --branch-ref ${{ github.ref }} \\\n        --branch-name ${{ github.ref_name }} \\\n        --build-definition-id ${{ steps.get_workflow_id.outputs.workflow_id }} \\\n        --build-id ${{ github.run_id }} \\\n        --repo-name ${{ github.event.repository.name }} \\\n        --repo-id ${{ github.repository_id }} \\\n        --repo-url ${{ github.event.repository.html_url }}\n```\n\n## Direct NPM Usage in GitHub Actions\n```yaml\n- name: Run Specmatic Insights Github Build Reporter\n  run: |\n    npx specmatic-insights-github-build-reporter \\\n      --org-id ${{ secrets.SPECMATIC_ORG_ID }} \\\n      --branch-ref ${{ github.ref }} \\\n      --branch-name ${{ github.ref_name }} \\\n      --build-definition-id ${{ steps.get_workflow_id.outputs.workflow_id }} \\\n      --build-id ${{ github.run_id }} \\\n      --repo-name ${{ github.event.repository.name }} \\\n      --repo-id ${{ github.repository_id }} \\\n      --repo-url ${{ github.event.repository.html_url }}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznsio%2Fspecmatic-insights-github-build-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fznsio%2Fspecmatic-insights-github-build-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznsio%2Fspecmatic-insights-github-build-reporter/lists"}