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

GitHub Action

Revive Action

v2.6.1

Revive Action

code

Revive Action

Lint your Go code with Revive

Installation

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

              

- name: Revive Action

uses: morphy2k/[email protected]

Learn more about this action in morphy2k/revive-action

Choose a version

Revive Action

This Action runs Revive on your Go code and adds annotations to the check.

Usage

Checkout

- name: Check out code into the Go module directory
  uses: actions/checkout@v4

Use by pulling pre-built image (recommended)

Docker Hub image

- name: Run Revive Action by pulling pre-built image
  uses: docker://morphy/revive-action:v2

GitHub Container registry image

- name: Run Revive Action by pulling pre-built image
  uses: docker://ghcr.io/morphy2k/revive-action:v2

Use by building from repository

- name: Run Revive Action by building from repository
  uses: morphy2k/revive-action@v2

Configuration

  with:
    # Path to your Revive config within the repo (optional)
    config: revive/config.toml
    # Exclude patterns, separated by semicolons (optional)
    exclude: "file.go;foo/bar.go;./foo/bar/..."
    # Path pattern (default: ./...)
    path: "./foo/..."

Workflow example

name: Lint
on:
  pull_request:
  push:
    paths:
      - '**.go'
      - 'go.mod'
      - 'go.sum'
      - 'revive.toml'

jobs:

  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:

    - name: Check out code into the Go module directory
      uses: actions/checkout@v4

    - name: Run Revive Action
      uses: docker://morphy/revive-action:v2
      with:
        config: revive.toml

Screenshots

Screenshot of annotations

GitHub Annotations