Skip to content

Warning

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

Autometrics Report

Actions
Get a report in autometrics coverage of functions in Pull Requests
v1.0.0
Verified creator
Star (15)

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

Autometrics Metrics Report

A Github action that comments on PRs to tell you how metrics are going to be affected

Inputs

  • gh-token: a github token that gives access to
    • the PR
    • the repo
    • read/write access to comments on issues/PR The permissions added in the "Example Usage" section allow to use the built-in ${{ secrets.GITHUB_TOKEN }} directly for that.
  • rs-roots: a list of project roots for rust projects, one root per line. The values are given relative to the root of the repository, and should point to the directory containing the Cargo.toml directory.
  • retention-days: the number of days to keep the list of functions as workflow artifacts. By default it will use the same retention settings as the settings in the repository (by setting retention-days to 0)
  • am-version: a string that allows to choose the version of am_list to download/use. You can skip the patch (e.g. 0.2) or the minor (e.g. 0) to tell the action to download the latest version that falls within the bound. Defaults to an empty string (""), which means "download the latest version, semver-wise"

Outputs

This action has no programmatic output to use in further steps. It only writes its output as a comment to the PR.

Example Usage

The job must only contain the diff-metrics step and the checkout one, otherwise the steps that follow might see an older version of the repository

name: Compare Metrics

on: [pull_request]

jobs:
  build:

    # The task only runs on linux x64 machines.
    runs-on: ubuntu-latest

    # Permissions are necessary to be able to edit and write comments on the PR
    permissions:
      issues: write
      pull-requests: write
      repository-projects: read
      contents: read

    steps:
    - uses: actions/checkout@v3
    - uses: autometrics-dev/diff-metrics@v1
      with:
        gh-token: ${{ secrets.GITHUB_TOKEN }}
        rust-roots: |
          .

Mono repo example

In the case of a mono repo that would look like

.
├── project-a
│  ├── README.md
│  │ ...
│  └── Cargo.toml
├── project-b
│  ├── README.md
│  │ ...
│  └── Cargo.toml
├── project-c
│  ├── README.md
│  │ ...
│  └── package.json
└── README.md

The step using diff-metrics would look like this:

uses: autometrics-dev/diff-metrics@v1
with:
  gh-token: ${{ secrets.GITHUB_TOKEN }}
  rust-roots: |
    project-a
    project-b
  ts-roots: |
    project-c

Autometrics Report is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Get a report in autometrics coverage of functions in Pull Requests
v1.0.0

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

Autometrics Report is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.