generated from scandar/typescript-action-vitest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
71 lines (64 loc) · 1.86 KB
/
action.yml
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
name: "ownyourcode"
description: "Identify orphan files missing codeowners"
author: "Girges Scandar"
# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: "users"
color: "orange"
inputs:
fail_on_missing_codeowners:
description: "Fail CI if there are files without owners"
default: "true"
required: false
github_token:
description: "Github Token"
required: true
pr_number:
description: "Scan only the files modified in the PR"
required: false
branch:
description: "Scan all files in the specified branch"
required: false
codeowners_path:
description: "Path to the codeowners file"
default: "CODEOWNERS"
required: false
outputs:
total_orphan_files:
description: "Total number of orphaned files"
value: ${{ steps.codeowners.outputs.total_orphan_files }}
total_scanned_files:
description: "Total files"
value: ${{ steps.codeowners.outputs.total_scanned_files }}
failed:
description: "If the action failed"
value: ${{ steps.codeowners.outputs.failed }}
runs:
using: "composite"
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
repository: "getyourguide/ownyourcode"
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm
- name: Install Dependencies
shell: bash
id: npm-ci
run: npm ci
- name: Check Codeowners
id: codeowners
shell: bash
run: node ./dist/index.js
env:
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_CODEOWNERS_PATH: ${{ inputs.codeowners_path }}
INPUT_PR_NUMBER: ${{ inputs.pr_number }}
INPUT_FAIL_ON_MISSING_CODEOWNERS:
${{ inputs.fail_on_missing_codeowners }}
INPUT_BRANCH: ${{ inputs.branch }}