-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaction.yml
53 lines (53 loc) · 1.7 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
name: 'deadnix-action'
description: 'Find unused Nix code, and create a pull request'
inputs:
flags:
description: 'Command-line flags to deadnix'
required: false
default: '--edit'
author:
description: >
The author name and email address in the format `Display Name <[email protected]>`.
Defaults to the user who triggered the workflow run.
required: false
default: '${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>'
committer:
description: >
The committer name and email address in the format `Display Name <[email protected]>`.
Defaults to the GitHub Actions bot user.
default: 'GitHub <[email protected]>'
directory:
description: 'Command-line flags to deadnix'
required: false
default: '.'
create_pr:
description: 'Whether to create a PR'
required: false
default: 'true'
commit_message:
description: 'Commit message'
required: false
default: 'Remove dead code'
runs:
using: 'composite'
steps:
- name: Nix dead code analysis
run: 'nix run nixpkgs#deadnix -- ${{ inputs.flags }} ${{ inputs.directory }}'
shell: bash
id: deadnix
- name: Create PR
uses: peter-evans/create-pull-request@v7
if: inputs.create_pr == 'true'
with:
author: '${{ inputs.author }}'
branch: deadnix
base: ${{ github.head_ref }}
delete-branch: true
title: '${{ inputs.commit_message }}'
commit-message: '${{ inputs.commit_message }}'
committer: '${{ inputs.committer }}'
body: |
Automated changes by the [deadnix-action](https://github.com/astro/deadnix-action) GitHub Action.
branding:
icon: 'minus-circle'
color: 'red'