Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check

GitHub Action

fish-shop/syntax-check

v2.2.9

fish-shop/syntax-check

check

fish-shop/syntax-check

A GitHub action for syntax checking fish shell files

Installation

Copy and paste the following snippet into your .yml file.

              

- name: fish-shop/syntax-check

uses: fish-shop/[email protected]

Learn more about this action in fish-shop/syntax-check

Choose a version

fish

fish-shop/syntax-check

OpenSSF Scorecard Tests Issues Dependabot License fish

A GitHub action for syntax checking fish shell files.


Here's an example from the test workflow for Pond:

Prerequisites

This action requires fish shell. You can install it using the fish-shop/install-fish-shell action.

Usage

Add a uses step to your GitHub workflow as shown below:

- name: Syntax check
  uses: fish-shop/syntax-check@v2

By default, all files under $GITHUB_WORKSPACE with a .fish file extension are checked. To override the default behaviour, provide one or more space-separated pattern values to the patterns input. For example, to check all .fish files starting in the src directory and descending into subdirectories:

- name: Syntax check
  uses: fish-shop/syntax-check@v2
  with:
    patterns: src/**.fish

Each pattern value may include wildcards and/or brace expansion:

- name: Syntax check
  uses: fish-shop/syntax-check@v2
  with:
    patterns: init.fish functions/**.fish {conf.d,completions}/**.fish tests/???-*.fish

Important

The ? wildcard character is deprecated and can be disabled via the fish feature flag qmark-noglob. Support for the ? wildcard may therefore be dependent upon the version of fish shell in use and/or the configuration of its feature flags.

Inputs

Configure the action using the following inputs:

Name Description Default
annotations The string value 'true' or 'false' indicating whether to enable annotations or not true
patterns A space-separated list of file patterns to match against when running syntax checks; each pattern may include wildcards and/or brace expansions **.fish
title The title to display in the job summary; can be used to distinguish multiple summaries generated from a single workflow Syntax check results

Outputs

The following outputs are made available to subsequent steps in a workflow:

Name Description
total The total number of files syntax checked
passed The number of files that passed syntax checks
failed The number of files that failed syntax checks

Annotations

Syntax issues identified by this action are displayed as annotations on the workflow summary page:

Workflow summary annotations

Annotations are also displayed directly alongside the code in the 'Files changed' tab of pull requests:

Pull request annotations

This behaviour can be disabled by setting the annotations input to false.

Job summary

This action generates a job summary at run-time which can be viewed from the workflow run summary page:

Job summary

Action versions

Use one of the following patterns when specifying the version reference for this action in your workflow (i.e. the {ref} value in uses: fish-shop/syntax-check@{ref}):

Pattern Example Description
vX v1 the latest v1.* release including non-breaking changes and bug fixes
vX.Y v1.1 the latest v1.1.* release including bug fixes
vX.Y.Z v1.1.0 the v1.1.0 release only

Tip

The recommended pattern is vX (e.g. v1). This will ensure that the version of the action used in your workflow includes the latest non-breaking changes and bug fixes, and guarantees compatibility with previous versions of that major release number.

Using a main branch reference in your workflow is not recommended as this branch may include breaking changes intended for the next major release.

Other GitHub actions

A number of related composite actions are also available from the fish-shop 🐟. Check them out:

Acknowledgements

License

fish-shop/syntax-check is provided under the terms of the MIT License.

Contact

Email me at [email protected] or create an issue.