Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is no formatter for 'github-actions-workflow' files installed

I am having trouble formatting GitHub Actions workflow files in my development environment.

Whenever I try to format these files, I receive the following error message:

enter image description here

Clicking on "Install Formatter" yields no results, and I'm unable to find a proper extension or setting to resolve this issue.

This is the extension: https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions

I have attempted to set up the YAML formatter to handle this, but it does not seem to work. Additionally, I have the following configuration in my settings.json file, but it's not effective:

settings.json

{
    "security.workspace.trust.untrustedFiles": "open",
    "[python]": {
        "editor.defaultFormatter": "ms-python.black-formatter"
    },
    "terminal.integrated.enableMultiLinePasteWarning": false,
    "python.terminal.activateEnvInCurrentTerminal": true,
    "[github-actions-workflow]": {
        "editor.defaultFormatter": "redhat.vscode-yaml"
    },
    "yaml.schemas": {
        "https://json.schemastore.org/github-workflow.json": [
            "*.github/workflows/*.yaml",
            "*.github/workflows/*.yml",
        ],
        "https://json.schemastore.org/github-action.json": [
            "action.yaml",
            "action.yml",
        ]
    },
    "explorer.confirmDelete": false,
    "git.autofetch": true
}

VS Code version

Version: 1.80.2
Commit: 2ccd690cbff1569e4a83d7c43d45101f817401dc
Date: 2023-07-27T20:57:59.134Z
Electron: 22.3.14
ElectronBuildId: 22695494
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Darwin arm64 22.6.0

enter image description here

Any other ideas what can be done ??

Expectation of Behaviour

I want to use my file format shortcut (CMD + OPT + L) to quickly adjust the file after pasting in sections (from documentation for instance), since yaml is easily broken by whitespace misalignment, this step is important. I have no problem with other yml files, they get formatted in this manner using redhat.vscode-yaml code formatter, would be great if it would also work for workflow yaml files when having this extension installed.

Current "Workaround"

My only "workaround", is to switch the association from github actions workflow to yaml, do the formatting and then change it back, that is cumbersome and I think this can be done via configuration within the settings.json I just don't see what is missing.

like image 716
VeRo Avatar asked May 22 '26 16:05

VeRo


1 Answers

This is a known issue with the VS code extension

After the exchange with @starball I revisited the extension repository (since it is being hosted and maintained over at GitHub), and sure enough the issue has been reported already.

Most likely the solution will come as an answer to this issue or a future issue that the project currently tracks.

like image 100
VeRo Avatar answered May 24 '26 20:05

VeRo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!