Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

morphy2k/revive-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
Open more actions menu

Repository files navigation

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

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

Note

Using a pre-built image is more resource-efficient and has a shorter execution time.

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.toml

    # Exclude patterns (default: vendor/...)
    exclude: |
      file.go
      foo/bar.go
      ./foo/bar/...

    # Path pattern (default: ./...)
    path: ./foo/...

    # Fail on any issue. Overrides the error and warning code in config (default: false)
    fail-on-any: true

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

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.