Skip to content

Troubleshooting

Overview

Detail

[1] Problem: What are the context metadata

To debug or see the contexts of any block in GitHub Actions, can use this steps to verify.

Add step in yaml like below

- name: Dump GitHub context
env:
    GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
    echo "$GITHUB_CONTEXT"

Reference:

[2] Problem: How to check the step status multiple

Use steps context outcome with following example

name: CI
on: [pull_request]
jobs:
  myjob:
    runs-on: ubuntu-latest
    steps:
      - name: Step 1
        id: hello
        run: <any>
        continue-on-error: true
      - name: Step 2
        id: world
        run: <any>
        continue-on-error: true
      - name: Check on failures
        if: steps.hello.outcome != 'success' || steps.world.outcome != 'success'
        run: exit 1

Note:

Avoid using continue-on-error:true because it will yield the different outputs and the metadata.

Reference:

[3] Problem: How to configuration the Slack Message

(a) We are using the GH Action from Marketplace: https://github.com/slackapi/slack-github-action

It's implement this API: https://api.slack.com/methods/chat.postMessage

Example on Slack arguments