Display GitHub Actions workflows and runs

4 minute read

Incorporate GHA into the platform to view workflows and runs executed in GitHub. If you have a GHA workflow set up in a GitHub repository integrated with the platform, you can view GHA workflow and/or run data in the following CloudBees platform screens:

The platform also provides links to:

All GHA workflow and run data is also available in the Component summary. To view, select Components, and then select the component containing the GHA workflow.

Prerequisites

Set up the CloudBees platform and GHA to work together, providing key features of the platform to GHA workflows. Refer to Getting started for more information.

View GHA workflows in the platform

Your GHA workflow and runs are now available for viewing in the platform. The component containing the GHA workflow is listed in the components list for your organization.

Select Components, and then select the component containing the GHA integration to view the component details.

Select Components  Workflows to list all workflows for that component.

In the Workflows listing, all GHA workflows contain the same information as CloudBees platform workflows, except:

  1. The Provider for all GHA workflows is identified as GitHub.

  2. To edit a GHA workflow, select the workflow file link to access the YAML file in GitHub. Currently, you cannot directly edit a GHA workflow in the platform. View the workflow file as read-only by selecting the workflow name.

Supported trigger types

The following trigger types in GHA workflows are fully supported:

Table 1. Supported trigger types from GHA workflows.
Trigger type DSL syntax

Push

push

Pull request

pull_request

Manual

workflow_dispatch

Scheduled

schedule

Reusable workflow

workflow_call

GitHub supports other trigger types. The platform lists runs invoked by these trigger types, but may not provide all relevant details for trigger events not listed above.

View GHA runs in the platform

After running your GHA workflow in GitHub, select Components in the CloudBees platform to select the component containing the GHA workflow, and then select Components  Runs to list all runs.

Only GHA runs that have occurred from your GHA workflow after its successful integration with the CloudBees platform are displayed.

In the Runs summary list, all GHA runs contain the same information as CloudBees platform workflow runs, except:

  1. All GHA runs include the GHA unique run attempt number, which increments only when a workflow is run using the 'Rerun' option in GitHub.

  2. The GHA workflow link redirects to the workflow YAML file in GitHub.

  3. The Provider for all GHA runs is identified as GitHub.

GHA runs
Figure 1. GHA compared to CloudBees workflow runs.

View GHA run details in the platform

All run details available for CloudBees platform runs are also displayed in the platform UI for GHA runs, except for job logs and deployment data. For more information, refer to Run details.

Check the supported trigger types section for more information about displayed run details.

View GHA job logs in the platform

Job information for a GHA workflow run is available in its run details. Select Components  Runs  Run details for your selected run, and then select the JOB LOGS tab in Jobs.

Currently, only step summaries are available in the platform. Select View logs on GitHub to access detailed job logs on GitHub.

GHA job logs
Figure 2. Highlighted link to view detailed GHA job logs.

View GHA workflows and runs in analytics dashboards

Data for GHA workflows and runs are displayed on the analytics dashboards for your organization.

The following dashboards are only populated once you add specific actions to your workflow. Refer to the dashboard documentation for more information:

In all analytics dashboards, the provider (GitHub) is listed where applicable. The following is an example from Analytics  Software delivery activity. Workflow runs is selected and lists both implicit security scans provided by CloudBees, and the GHA workflow runs, provided by GitHub.

GHA run and implicit scan
Figure 3. Different providers highlighted in Workflow runs.

Full GHA workflow and run example

The following GHA workflow example performs the following tasks and displays the results in the platform UI:

Example GHA workflow YAML file
name: GHA workflow on: workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - name: Compile code run: echo "Compiling..." - name: Produce binary run: sleep 5 - name: Push binary run: echo "Pushing Binary to ECR..." - name: Register build artifacts in Cloudbees platform uses: cloudbees-io-gha/register-build-artifact@v1 id: go-action with: name: "GHA App" version: 1.0.5 url: docker.io/MyApp/GHA App:1.0.5 digest: "sha256:1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr" type: "docker" cloudbees-pat: ${{ secrets.CBP_PAT }} - name: Publish evidence uses: cloudbees-io-gha/publish-evidence-item@v1 with: cloudbees-pat: ${{ secrets.CBP_PAT }} content: |- Build Completed and artifacts published to Cloudbees platform test: runs-on: ubuntu-latest needs: [build] # Depends on 'build' job steps: - name: Run tests run: echo "Running Tests..." - name: Checkout to collect test results uses: actions/checkout@v3 - name: Publish test results in Cloudbees platform uses: cloudbees-io-gha/publish-test-results@v1 with: test-type: GO folder-path: test_reports/* cloudbees-pat: ${{ secrets.CBP_PAT }} - name: Publish evidence in Cloudbees platform uses: cloudbees-io-gha/publish-evidence-item@v1 with: cloudbees-pat: ${{ secrets.CBP_PAT }} content: |- Testing Completed and results published to Cloudbees platform Test | Results | --------|---------| Test 1 | PASS | Test 2 | FAIL | Test 3 | PASS | deploy: runs-on: ubuntu-latest needs: [build, test] # Depends on both 'build' and 'test' jobs steps: - name: Checkout to prepare manifest uses: actions/checkout@v3 - name: Trigger deployment uses: cloudbees-io-gha/run-cloudbees-workflow@v1 id: deploy with : cloudbees-pat: ${{ secrets.CBP_PAT }} workflow-file-name: "deploy.yaml" workflow-inputs: '{"artifactName": "GHA App","artifactVersion": "1.0.5", "environment": "qa"}' - name: Use runUrl output run: echo "The CloudBees run URL is ${{ steps.deploy.outputs.cbp_run_url}}"

After the run has completed, the:

  • Artifact information is displayed in both Components  Artifacts and Run details  Build artifacts in the CloudBees platform.

    Artifact displayed
    Figure 4. Artifact displayed in the platform.
  • Evidence output is collected and displayed in the Evidence tab of Run details.

    Build evidence displayed
    Figure 5. Evidence from build job displayed in the platform.
    Test evidence displayed
    Figure 6. Evidence from test job displayed in the platform.
  • Testing results are collected and displayed in the Test results tab of Run details and in the Test insights dashboard.

    Test results displayed
    Figure 7. Testing results from test job displayed in the platform.
  • CloudBees platform workflow run is triggered by the GHA workflow and the workflow output is published in the job evidence.

    Deploy evidence displayed
    Figure 8. Resulting CloudBees platform workflow run output.