Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
74 lines (70 loc) · 2.23 KB
/
Copy pathaction.yml
File metadata and controls
74 lines (70 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: github-agent
description: Audit a repository's documentation, metadata and changelog with ghagent.
author: paulmann
branding:
icon: check-circle
color: green
inputs:
command:
description: >-
Arguments passed to ghagent. The default audits the repository and requires a score
of 80 or higher.
required: false
default: audit . --min-score 80
min-score:
description: >-
Minimum audit score. Applied only when `command` runs `audit` without an explicit
`--min-score`; the default command already carries the flag.
required: false
default: "80"
working-directory:
description: Directory to run ghagent in, relative to the repository root.
required: false
default: "."
python-version:
description: Python version used to run ghagent.
required: false
default: "3.13"
github-token:
description: >-
Token exported as GITHUB_TOKEN so remote commands (`audit --repo`,
`meta apply`) can authenticate. The default is the workflow's own token.
required: false
default: ${{ github.token }}
runs:
using: composite
steps:
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: ${{ inputs.python-version }}
- name: Install github-agent from this action checkout
shell: bash
env:
ACTION_PATH: ${{ github.action_path }}
run: |
set -euo pipefail
python -m pip install --disable-pip-version-check --no-input "$ACTION_PATH"
- name: Run ghagent
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
INPUT_COMMAND: ${{ inputs.command }}
INPUT_MIN_SCORE: ${{ inputs.min-score }}
INPUT_WORKING_DIRECTORY: ${{ inputs.working-directory }}
run: |
set -euo pipefail
cd "$GITHUB_WORKSPACE/$INPUT_WORKING_DIRECTORY"
args="$INPUT_COMMAND"
case "$args" in
audit*)
case "$args" in
*--min-score*) ;;
*) args="$args --min-score $INPUT_MIN_SCORE" ;;
esac
;;
esac
echo "+ ghagent $args"
# Word splitting is intended: the input is a command line, not one argument.
# shellcheck disable=SC2086
ghagent $args