---
title: Debugging GitHub Actions
date: "2025-01-14"
author: "Birgit Pauli-Haack"
url: "https://icodeforapurpose.com/debugging-github-actions/"
categories: ["Site News"]
---

I had a [workflow glued together](https://github.com/WordPress/developer-blog-content/compare/c6ecb1e0e781baf31b1d9001ff9da35719e0b265...c8c0f3644c739ca29d8a550db282ff52aa7140f0), but couldn’t figure out why it wouldn’t work. As I know very little about action and YML notation, I ask a co-worker if he would have some time to look over it.

There were the issues we fixed together.

- add extension to file name *yml
- Remove : from label. Use –
- Enclose if-clause in ${{ curly brackets }}
- Instead of > use | in Body
- Indentation is important

Before you can test things, you would need GitHub to actually run the action, and that only happens when a file has the *yml extension.

Note: The label that should trigger the workflow can have a colon in the name, that comes out as a syntax error with yml notation. It’s a bit odd that a little : would cause so much trouble. Here is a [discussion calling it a GitHub Bug.](https://github.com/actions/runner/issues/1019) I haven’t tested the workarounds suggested yet, though.

Changed the label from “flow: ready to publish” to “flow-ready to publish”

The example code didn’t enclose the if-clause in brackets.

Before:

```
`if: github.event.label.name == 'flow: ready to publish'`
```

After

```
if: ${{ github.event.label.name == 'flow-ready to publish' }}
```

The original code used > to start the comment BODY. GitHub uses | instead.

YML is also finicky with indentation.

Instead of this code

```
BODY: >### Pre-publishing checklist: (updated 12/09/2024)
- [ ] Post Title and subheaders in sentence case
```

It’s correct to use this:

```
BODY: | 
        ### Pre-publishing checklist
        - [ ] Post Title and subheaders in sentence case
```

The | (pipe) and the start of the new lines need to line up to display correctly in the resulting comment.

Also tested:

- You can do Markdown heading `###`
- You can use Emojis and links.

![](http://localhost:undefined/wp-content/uploads/2025/01/Screenshot-2025-01-14-at-11.25.42.png)

The resulting code is [now available on GitHub and works. ](https://github.com/WordPress/developer-blog-content/blob/trunk/.github/workflows/add-publish-checks.yml)

### Like this:
Like Loading…