You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Autometrics Report
v1.0.0
A Github action that comments on PRs to tell you how metrics are going to be affected
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 theCargo.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 settingretention-days
to 0)am-version
: a string that allows to choose the version ofam_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"
This action has no programmatic output to use in further steps. It only writes its output as a comment to the PR.
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: |
.
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