Skip to content

Commit 1dc6713

Browse files
committed
feat: Change default config file name
1 parent 97b68d8 commit 1dc6713

File tree

6 files changed

+25
-8
lines changed

6 files changed

+25
-8
lines changed

.github/commenter.yml renamed to .github/label-commenter-config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ labels:
3232
issue:
3333
body: This issue or pull request already exists.
3434
action: close
35+
- name: good first issue
36+
labeled:
37+
issue:
38+
body: This issue is easy for contributing. Everyone can work on this.

.github/workflows/commenter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
uses: peaceiris/actions-label-commenter@v1
2323
with:
2424
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
# config_file: .github/commenter.yml
25+
# config_file: .github/label-commenter-config.yml

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
uses: peaceiris/actions-label-commenter@v1
5050
with:
5151
github_token: ${{ secrets.GITHUB_TOKEN }}
52-
# config_file: .github/commenter.yml
52+
# config_file: .github/label-commenter-config.yml
5353
```
5454

5555
### Action Setting
@@ -91,6 +91,10 @@ labels:
9191
issue:
9292
body: This issue or pull request already exists.
9393
action: close
94+
- name: good first issue
95+
labeled:
96+
issue:
97+
body: This issue is easy for contributing. Everyone can work on this.
9498
```
9599
96100

__tests__/get-inputs.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,19 @@ describe('getInputs()', () => {
3131
const inps: Inputs = getInputs();
3232

3333
expect(inps.GithubToken).toMatch('secret_token');
34-
expect(inps.ConfigFilePath).toMatch('.github/commenter.yml');
34+
expect(inps.ConfigFilePath).toMatch('.github/label-commenter-config.yml');
3535
});
3636

3737
test('get spec inputs', () => {
3838
process.env['INPUT_GITHUB_TOKEN'] = 'secret_token';
39-
process.env['INPUT_CONFIG_FILE'] = '.github/config/commenter.yml';
39+
process.env['INPUT_CONFIG_FILE'] =
40+
'.github/config/label-commenter-config.yml';
4041

4142
const inps: Inputs = getInputs();
4243

4344
expect(inps.GithubToken).toMatch('secret_token');
44-
expect(inps.ConfigFilePath).toMatch('.github/config/commenter.yml');
45+
expect(inps.ConfigFilePath).toMatch(
46+
'.github/config/label-commenter-config.yml'
47+
);
4548
});
4649
});

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ inputs:
77
required: true
88
config_file:
99
description: 'Path to action setting file'
10-
default: '.github/commenter.yml'
10+
default: '.github/label-commenter-config.yml'
1111
required: false
1212
runs:
1313
using: 'node12'

src/main.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@ export async function run(): Promise<void> {
7777
});
7878

7979
if (!isExistLabel) {
80-
core.info(`[INFO] no configuration for ${labelName}`);
80+
core.info(`[INFO] no configuration for labels.${labelName}`);
8181
return;
8282
}
8383

8484
if (config.labels[labelIndex][`${labelEvent}`] === void 0) {
85-
core.info(`[INFO] no configuration for ${labelName} ${labelEvent}`);
85+
core.info(
86+
`[INFO] no configuration for labels.${labelName}.${labelEvent}`
87+
);
8688
return;
8789
}
8890

@@ -131,6 +133,10 @@ export async function run(): Promise<void> {
131133
await closeIssue(githubClient, issueNumber);
132134
} else if (finalAction === 'open') {
133135
await openIssue(githubClient, issueNumber);
136+
} else {
137+
core.info(
138+
`[INFO] no configuration for labels.${labelName}.${labelEvent}.${eventType}.action`
139+
);
134140
}
135141

136142
return;

0 commit comments

Comments
 (0)