forked from MBilalShafi/no-response-add-label
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
98 lines (91 loc) · 3.72 KB
/
action.yml
File metadata and controls
98 lines (91 loc) · 3.72 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: no-response
description: Closes Issues where the original author doesn't respond to a request for information
inputs:
closeComment:
description: Comment to post when closing an Issue for lack of response. Set to `false` to disable.
default: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further.
daysUntilClose:
description: Number of days of inactivity before an Issue is closed for lack of response
default: 14
responseRequiredColor:
description: Color for the `responseRequiredLabel`
default: ffffff
responseRequiredLabel:
description: Label indicating that a response from the original author is required
default: more-information-needed
optionalFollowUpColor:
description: Color for the `optionalFollowUpLabel`
optionalFollowUpLabel:
description: Label that will be added after the required label will be removed
optionalFollowUpLabelColor:
description: 'Compatibility: Color for the `optionalFollowUpLabel`'
maxIssuesPerRun:
description: Number of Issues to close per workflow run
default: 50
token:
description: Token to access the GitHub API
default: ${{ github.token }}
required: false
runs:
using: 'composite'
steps:
- name: Provide files to hash
shell: bash
run: |
set +e
shopt -s nullglob
dir="$(realpath .remote-action-hashFiles)" &&
rm -v -rf "${dir}" &&
mkdir -v "${dir}" &&
cd "${{ github.action_path }}" &&
cp -v -a -t "${dir}/" src package.json *.lock *-lock.json
exit 0
- name: Cache Compiled Binary
id: cache-binary
uses: actions/cache@v5
with:
path: ${{ github.action_path }}/bin/no-response-bin
key: no-response-bin-${{ runner.os }}-${{ hashFiles('.remote-action-hashFiles/**') }}
- name: Cleanup temporary hash files
if: always() # Run even if hashing or caching failed
shell: bash
run: rm -v -rf .remote-action-hashFiles
- name: Setup Bun
if: steps.cache-binary.outputs.cache-hit != 'true'
uses: oven-sh/setup-bun@v2
- name: Build Binary
if: steps.cache-binary.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{ github.action_path }}
run: |
test -s bun.lock || bun install --lockfile-only
bun install --production --frozen-lockfile
mkdir -p bin
bun build --compile --outfile bin/no-response-bin ./src/main.ts
chmod a+rx bin/no-response-bin
- name: Run Action
id: run-action
shell: bash
working-directory: ${{ github.action_path }}
env:
BUN_CONFIG_VERBOSE_FETCH: 'true'
INPUT_TOKEN: ${{ inputs.token }}
INPUT_CLOSECOMMENT: ${{ inputs.closeComment }}
INPUT_DAYSUNTILCLOSE: ${{ inputs.daysUntilClose }}
INPUT_RESPONSEREQUIREDCOLOR: ${{ inputs.responseRequiredColor }}
INPUT_RESPONSEREQUIREDLABEL: ${{ inputs.responseRequiredLabel }}
INPUT_OPTIONALFOLLOWUPCOLOR: ${{ inputs.optionalFollowUpColor }}
INPUT_OPTIONALFOLLOWUPLABEL: ${{ inputs.optionalFollowUpLabel }}
INPUT_OPTIONALFOLLOWUPLABELCOLOR: ${{ inputs.optionalFollowUpLabelColor }}
INPUT_MAXISSUESPERRUN: ${{ inputs.maxIssuesPerRun }}
run: ./bin/no-response-bin
- name: Handle Failure
if: failure() && 'failure' == steps.run-action.outcome
shell: bash
run: |
echo "::error::The Bun binary failed to execute. Check logs for details."