Skip to content

Commit

Permalink
Updated to the latest version of build report where instead of env va…
Browse files Browse the repository at this point in the history
…riables we pass them as cli arguments
  • Loading branch information
nashjain authored May 27, 2024
1 parent e50b77f commit 4d91855
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,26 @@ jobs:
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
- name: Run Specmatic Insights Github Build Reporter
uses: znsio/[email protected]
- name: Get Workflow Definition ID
id: get_workflow_id
env:
SPECMATIC_ORG_ID: ${{ secrets.SPECMATIC_ORG_ID }}
GITHUB_TOKEN: ${{ secrets.SPECMATIC_INSIGHTS_ACCESS_TOKEN }}
GITHUB_REF: ${{ github.ref }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
GITHUB_REPOSITORY_ID: ${{ github.repository_id }}
GITHUB_SERVER_URL: ${{ github.server_url }}
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
echo "workflow_id=$workflow_id" >> "$GITHUB_OUTPUT"
- name: Run Specmatic Insights Github Build Reporter
uses: znsio/[email protected]
with:
org-id: ${{ secrets.SPECMATIC_ORG_ID }}
branch-ref: ${{ github.ref }}
branch-name: ${{ github.ref_name }}
build-definition-id: ${{ steps.get_workflow_id.outputs.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 }}

0 comments on commit 4d91855

Please sign in to comment.