Skip to content

Commit 9d13cbd

Browse files
feat: Build for release
1 parent e074e37 commit 9d13cbd

File tree

272 files changed

+29910
-41058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+29910
-41058
lines changed

.editorconfig

Lines changed: 0 additions & 13 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 149 deletions
This file was deleted.

README.ja.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Assign Author
2+
3+
[![Build Status](https://github.com/technote-space/assign-author/workflows/Build/badge.svg)](https://github.com/technote-space/assign-author/actions)
4+
[![codecov](https://codecov.io/gh/technote-space/assign-author/branch/master/graph/badge.svg)](https://codecov.io/gh/technote-space/assign-author)
5+
[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/assign-author/badge)](https://www.codefactor.io/repository/github/technote-space/assign-author)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/technote-space/assign-author/blob/master/LICENSE)
7+
8+
*Read this in other languages: [English](README.md), [日本語](README.ja.md).*
9+
10+
Issue や Pull Request に Author をアサインする GitHub Action です。
11+
12+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
13+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
14+
**Table of Contents**
15+
16+
- [スクリーンショット](#%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88)
17+
- [インストール](#%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB)
18+
- [Action イベント詳細](#action-%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E8%A9%B3%E7%B4%B0)
19+
- [対象イベント](#%E5%AF%BE%E8%B1%A1%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88)
20+
- [このアクションを使用しているアクションの例](#%E3%81%93%E3%81%AE%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E4%BE%8B)
21+
- [Author](#author)
22+
23+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
24+
25+
## スクリーンショット
26+
![GitHub Action](https://raw.githubusercontent.com/technote-space/assign-author/images/screenshot.gif)
27+
28+
## インストール
29+
1. workflow を設定
30+
e.g. `.github/workflows/pull_request.yml`
31+
```yaml
32+
on:
33+
pull_request:
34+
types: [opened]
35+
name: Pull Request
36+
jobs:
37+
assignAuthor:
38+
name: Assign author to PR
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Assign author to PR
42+
uses: technote-space/assign-author@v1
43+
with:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
```
46+
e.g. `.github/workflows/issues.yml`
47+
```yaml
48+
on:
49+
issues:
50+
types: [opened]
51+
name: Issues
52+
jobs:
53+
assignAuthor:
54+
name: Assign author to issue
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Assign author to issue
58+
uses: technote-space/assign-author@v1
59+
with:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
```
62+
63+
## Action イベント詳細
64+
### 対象イベント
65+
| eventName | action |
66+
|:---:|:---:|
67+
|pull_request|opened|
68+
|pull_request|rerequested|
69+
|issues|opened|
70+
|issues|rerequested|
71+
72+
## このアクションを使用しているアクションの例
73+
- [Release GitHub Actions](https://github.com/technote-space/release-github-actions)
74+
- [issue_opened.yml](https://github.com/technote-space/release-github-actions/blob/master/.github/workflows/issue_opened.yml)
75+
- [pr_opened.yml](https://github.com/technote-space/release-github-actions/blob/master/.github/workflows/pr_opened.yml)
76+
- [Auto card labeler](https://github.com/technote-space/auto-card-labeler)
77+
- [issue_opened.yml](https://github.com/technote-space/auto-card-labeler/blob/master/.github/workflows/issue_opened.yml)
78+
- [pr_opened.yml](https://github.com/technote-space/auto-card-labeler/blob/master/.github/workflows/pr_opened.yml)
79+
- [Assign Author](https://github.com/technote-space/assign-author)
80+
- [issue_opened.yml](https://github.com/technote-space/assign-author/blob/master/.github/workflows/issue_opened.yml)
81+
- [pr_opened.yml](https://github.com/technote-space/assign-author/blob/master/.github/workflows/pr_opened.yml)
82+
- [TOC Generator](https://github.com/technote-space/toc-generator)
83+
- [issue_opened.yml](https://github.com/technote-space/toc-generator/blob/master/.github/workflows/issue_opened.yml)
84+
- [pr_opened.yml](https://github.com/technote-space/toc-generator/blob/master/.github/workflows/pr_opened.yml)
85+
- [Package Version Check Action](https://github.com/technote-space/package-version-check-action)
86+
- [issue_opened.yml](https://github.com/technote-space/package-version-check-action/blob/master/.github/workflows/issue_opened.yml)
87+
- [pr_opened.yml](https://github.com/technote-space/package-version-check-action/blob/master/.github/workflows/pr_opened.yml)
88+
89+
## Author
90+
[GitHub (Technote)](https://github.com/technote-space)
91+
[Blog](https://technote.space)

README.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Assign Author
22

33
[![Build Status](https://github.com/technote-space/assign-author/workflows/Build/badge.svg)](https://github.com/technote-space/assign-author/actions)
4-
[![Coverage Status](https://coveralls.io/repos/github/technote-space/assign-author/badge.svg?branch=master)](https://coveralls.io/github/technote-space/assign-author?branch=master)
4+
[![codecov](https://codecov.io/gh/technote-space/assign-author/branch/master/graph/badge.svg)](https://codecov.io/gh/technote-space/assign-author)
55
[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/assign-author/badge)](https://www.codefactor.io/repository/github/technote-space/assign-author)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/technote-space/assign-author/blob/master/LICENSE)
77

8-
GitHub actions to assign author to issue or PR.
8+
*Read this in other languages: [English](README.md), [日本語](README.ja.md).*
9+
10+
`GitHub action` to assign author to issue or PR.
911

1012
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1113
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -27,7 +29,9 @@ GitHub actions to assign author to issue or PR.
2729
1. Setup workflow
2830
e.g. `.github/workflows/pull_request.yml`
2931
```yaml
30-
on: pull_request
32+
on:
33+
pull_request:
34+
types: [opened]
3135
name: Pull Request
3236
jobs:
3337
assignAuthor:
@@ -42,7 +46,9 @@ GitHub actions to assign author to issue or PR.
4246
```
4347
e.g. `.github/workflows/issues.yml`
4448
```yaml
45-
on: issues
49+
on:
50+
issues:
51+
types: [opened]
4652
name: Issues
4753
jobs:
4854
assignAuthor:
@@ -58,14 +64,29 @@ GitHub actions to assign author to issue or PR.
5864

5965
## Action event details
6066
### Target events
61-
- pull_request: opened
62-
- issues: opened
67+
| eventName | action |
68+
|:---:|:---:|
69+
|pull_request|opened|
70+
|pull_request|rerequested|
71+
|issues|opened|
72+
|issues|rerequested|
6373

6474
## GitHub Actions using this Action
65-
- [Assign Author](https://github.com/technote-space/assign-author)
66-
- [TOC Generator](https://github.com/technote-space/toc-generator)
6775
- [Release GitHub Actions](https://github.com/technote-space/release-github-actions)
76+
- [issue_opened.yml](https://github.com/technote-space/release-github-actions/blob/master/.github/workflows/issue_opened.yml)
77+
- [pr_opened.yml](https://github.com/technote-space/release-github-actions/blob/master/.github/workflows/pr_opened.yml)
6878
- [Auto card labeler](https://github.com/technote-space/auto-card-labeler)
79+
- [issue_opened.yml](https://github.com/technote-space/auto-card-labeler/blob/master/.github/workflows/issue_opened.yml)
80+
- [pr_opened.yml](https://github.com/technote-space/auto-card-labeler/blob/master/.github/workflows/pr_opened.yml)
81+
- [Assign Author](https://github.com/technote-space/assign-author)
82+
- [issue_opened.yml](https://github.com/technote-space/assign-author/blob/master/.github/workflows/issue_opened.yml)
83+
- [pr_opened.yml](https://github.com/technote-space/assign-author/blob/master/.github/workflows/pr_opened.yml)
84+
- [TOC Generator](https://github.com/technote-space/toc-generator)
85+
- [issue_opened.yml](https://github.com/technote-space/toc-generator/blob/master/.github/workflows/issue_opened.yml)
86+
- [pr_opened.yml](https://github.com/technote-space/toc-generator/blob/master/.github/workflows/pr_opened.yml)
87+
- [Package Version Check Action](https://github.com/technote-space/package-version-check-action)
88+
- [issue_opened.yml](https://github.com/technote-space/package-version-check-action/blob/master/.github/workflows/issue_opened.yml)
89+
- [pr_opened.yml](https://github.com/technote-space/package-version-check-action/blob/master/.github/workflows/pr_opened.yml)
6990

7091
## Author
7192
[GitHub (Technote)](https://github.com/technote-space)

build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"tagName":"v1.1.1","branch":"gh-actions","tags":["v1.1.1","v1","v1.1"],"updated_at":"2019-09-15T18:00:19.541Z"}
1+
{"tagName":"test/v1.2.0","branch":"gh-actions","tags":["test/v1.2.0","test/v1","test/v1.2"],"updated_at":"2019-09-29T08:52:29.608Z"}

jest.setup.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

lib/constant.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
33
exports.TARGET_EVENTS = {
4-
'issues': 'opened',
5-
'pull_request': 'opened',
4+
'issues': ['opened', 'rerequested'],
5+
'pull_request': ['opened', 'rerequested'],
66
};

lib/main.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
1515
const path_1 = __importDefault(require("path"));
1616
const core_1 = require("@actions/core");
1717
const github_1 = require("@actions/github");
18-
const signale_1 = __importDefault(require("signale"));
19-
const misc_1 = require("./utils/misc");
18+
const filter_github_action_1 = require("@technote-space/filter-github-action");
19+
const github_action_helper_1 = require("@technote-space/github-action-helper");
2020
const context_1 = require("./utils/context");
2121
const github_2 = require("./utils/github");
22+
const constant_1 = require("./constant");
23+
const { showActionInfo } = github_action_helper_1.Utils;
2224
/**
2325
* run
2426
*/
2527
function run() {
2628
return __awaiter(this, void 0, void 0, function* () {
2729
try {
28-
const version = misc_1.getBuildVersion(path_1.default.resolve(__dirname, '..', 'build.json'));
29-
if ('string' === typeof version) {
30-
signale_1.default.info('Version: %s', version);
31-
}
32-
signale_1.default.info('Event: %s', github_1.context.eventName);
33-
signale_1.default.info('Action: %s', github_1.context.payload.action);
34-
if (!misc_1.isTargetEvent(github_1.context)) {
35-
signale_1.default.info('This is not target event.');
30+
const logger = new github_action_helper_1.Logger();
31+
showActionInfo(path_1.default.resolve(__dirname, '..'), logger, github_1.context);
32+
if (!filter_github_action_1.isTargetEvent(constant_1.TARGET_EVENTS, github_1.context)) {
33+
logger.info('This is not target event.');
3634
return;
3735
}
38-
yield github_2.addAssignees(context_1.getAssignees(github_1.context), new github_1.GitHub(core_1.getInput('GITHUB_TOKEN', { required: true })), github_1.context);
36+
yield github_2.addAssignees(context_1.getAssignees(github_1.context), new github_1.GitHub(core_1.getInput('GITHUB_TOKEN', { required: true })), logger, github_1.context);
3937
}
4038
catch (error) {
4139
core_1.setFailed(error.message);

0 commit comments

Comments
 (0)