Skip to content

Commit

Permalink
build: release v2.0.0 via b24c5a9
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Mar 7, 2022
0 parents commit 0d1be48
Show file tree
Hide file tree
Showing 8 changed files with 446 additions and 0 deletions.
76 changes: 76 additions & 0 deletions CONTRIBUTING-ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# HOW TO CONTRIBUTE

English guideline is [here](CONTRIBUTING.md).

当プロジェクトに関心を寄せていただき、ありがとうございます。このプロジェクトはオープン ソースであるため、誰でもプロジェクトに貢献することができます。皆様がプロジェクトへの貢献を円滑に行えるよう、以下の事項を守っていただけますようお願いします。

## TOC

- [始め方](#getting-started)
- [Issue (課題)](#send-issue)
- [変更内容の作成](#making-changes)
- [コードスタイル](#coding-style)
- [ドキュメント・翻訳](#documentation-or-translation)
- [Pull Request (変更リクエスト)](#pull-request)
- [謝辞](#thanks)

## Getting Started

- このプロジェクトに貢献する為には [GitHub アカウント](https://github.com/signup/free) が必要です。

## Send issue

- 重複する Issue がないかどうか、はじめに検索してください。
- 機能要望(新機能の追加、既存機能の変更など)には、**必ず** Issue を作成してください。
- 小さなバグ修正やリファクタリングなどは、Issue を作成せずに直接 Pull Request を送っても構いません。ただし、規模が大きい場合は、事前に Issue を作成し、了解を取ってから作業を始めてください。
- Issue を送るのに、事前の連絡は必要ありません。
- Issue のタイトルと本文はできるだけ英語で書いてください。
- 英語に慣れていない場合は日本語を使ってください。不正確な英語では、英語話者・日本語話者のどちらにも伝わりません。
- バグを Issue で報告する場合、バグを再現する為の説明、エラーの情報、環境を書いてください。
- 本文は明確に記述し、1 行のみの Issue を送ることは避けてください。

## Making Changes

- コードやドキュメントを DDRadar に貢献するには、ベースとなるブランチ(多くの場合 `main` です)から、トピック・ブランチを作ってください。(`issue_999`, `hotfix/song-page`など)
- 変更の為にテストが必要ならば、そのテストも追加または変更してください。
- commit は合理的(ロジック単位)に分けてください。また目的と関係のないコードの変更は含めないでください(コードフォーマットの変更、不要コードの削除など)。
- commit メッセージが正しいフォーマットであることを確認してください。commit メッセージはできるだけ英語でお願いします。
- commit メッセージには、下記の修飾子を先頭につけてください。([angular.js/DEVELOPERS.md](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type)に準じます)
- **feat**: 新機能
- **fix**: バグ修正
- **docs**: ドキュメントの修正のみ
- **style**: コードの意味を変更しない修正 (スペース・フォーマット・セミコロンなど)
- **refactor**: バグや機能追加ではないコード修正
- **perf**: コードの高速化に寄与する修正
- **test**: テストの追加、または修正
- **chore**: ビルド構成の変更やライブラリの更新など

```text
修飾子(サブカテゴリ): コミットの概要
<ここは空行>
3行目以降に、このコミットの詳細を記述します。
```

### Coding Style

- Lint ルールか、すでにあるコードのスタイルに準じます。
- 非 ASCII 文字(日本語など)を変数名に使用しないでください。
- コードのコメント部分に非 ASCII 文字を使うのは構いませんが、今後のリリースで英語に変更される可能性があることに留意してください。

### Documentation or Translation

- **大歓迎です!!**
- このドキュメントを含め(注: [英語版](CONTRIBUTING.md)のことです)、不完全な英語を使っている箇所があります。
オーナーは英語話者ではないため、そういった部分の修正を大いに歓迎します。

## Pull Request

- タイトルは変更の要約を分かりやすく書いてください。
- 本文には、関連する issue の番号を本文に含めてください。( ref #199 など)
- まだ作業中である場合、タイトルの先頭に `[WIP]` を付け、Draft Pull Request で送信してください。マージ可能になったら、`[WIP]` を除去し、Draft を外してください。
- 作業中に main ブランチが変更された場合は、競合を解消してから `[WIP]` を除去してください。
- その作業を予約する意味で、まず `[WIP]` の付いた Pull Request を投稿しても構いません。ただし、長い間活動が見られない場合は、クローズされる場合があります。

## Thanks

このガイドは、[MMP/CONTRIBUTING.md · sn0w75/MMP](https://github.com/sn0w75/MMP/blob/master/CONTRIBUTING.md) (削除済み)を参考にして作成しました。
73 changes: 73 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# HOW TO CONTRIBUTE

日本語版のガイドは[こちら](./CONTRIBUTING-ja.md)です。

Thank you for your interest in this project. This project is open source, and anyone can contribute to the project. Please follow the instructions below to ensure that you can contribute smoothly.

## TOC

- [Getting Started](#getting-started)
- [Send issue](#send-issue)
- [Making Changes](#making-changes)
- [Coding Style](#coding-style)
- [Documentation or Translation](#documentation-or-translation)
- [Pull Request](#pull-request)
- [Thanks](#thanks)

## Getting Started

- You need your [GitHub account](https://github.com/signup/free) to contribute this project.

## Send issue

- Search for the same issue before submitting it.
- Be sure to create an issue to have a feature request.
- For small bug fixes or refactorings, you can send PR directly, but if they are a big change, create an issue in advance and get approval.
- You have not to contact us before you send issue.
- You may use English, or Japanese.
- Write things exactly, and Don't send issues with only one sentence.

## Making Changes

- Checkout your topic branch from base branch(often `main`) to create code or documents. (ex. `issue_99`, `hotfix/song-page`)
- Add or Change test if you need.
- Commit should be logical units. Do not include extra code changes.
- Add prefix to commit message (inherits [angular.js/DEVELOPERS.md](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type))
- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation only changes
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation

```text
prefix(category): summery
<blank line>
detail
```

### Coding Style

- Follow Lint rules or existing code style.
- Do not use non-ASCII characters for variable names.
- You can use non-ASCII characters in comment block, but it might be deleted future release.

## Documentation or Translation

- *Welcome!!*
- Some document, including this one, use [AYBABTU](https://en.wikipedia.org/wiki/All_your_base_are_belong_to_us) English.
Repo owner is not an English speaker, so we welcome any modifications to those.

## Pull Request

- Title should include a clear summary of the changes.
- Add related issue number to your description.(ex. ref #199)
- If PR is in progress, add `[WIP]` prefix and send as Draft Pull Request. And remove `[WIP]` and Draft when we can review.
- Resolve conflict to `main` before you remove `[WIP]` prefix.
- To reserve the work, You may submit a Pull Request with `[WIP]` first. However, if there is no activity for a long time, it may be closed.

## Thanks

ref. [MMP/CONTRIBUTING.md · sn0w75/MMP](https://github.com/sn0w75/MMP/blob/master/CONTRIBUTING.md) (Deleted)
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

The MIT License (MIT)

Copyright (c) 2020-2021 DDRadar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
96 changes: 96 additions & 0 deletions README-ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Choose Random Action

[![last commit](https://img.shields.io/github/last-commit/ddradar/choose-random-action "last commit")](https://github.com/ddradar/choose-random-action/commits/main)
[![release version](https://img.shields.io/github/v/release/ddradar/choose-random-action?sort=semver "release version")](https://github.com/ddradar/choose-random-action/releases)
[![Node.js CI](https://github.com/ddradar/choose-random-action/actions/workflows/node.yml/badge.svg)](https://github.com/ddradar/choose-random-action/actions/workflows/node.yml)
[![codecov](https://codecov.io/gh/ddradar/choose-random-action/branch/main/graph/badge.svg?token=VfAjX7k1B4)](https://codecov.io/gh/ddradar/choose-random-action)
[![CodeFactor](https://www.codefactor.io/repository/github/ddradar/choose-random-action/badge)](https://www.codefactor.io/repository/github/ddradar/choose-random-action)
[![License](https://img.shields.io/github/license/ddradar/choose-random-action)](LICENSE)

English guide is [here](./README.md).

ユーザーからの複数入力から、1つをランダムに選択します。

## TOC

- [使い方](#usage)
- [基本](#basic)
- [Post LGTM Imageと使う](#use-with-post-lgtm-image)
- [オプション](#options)
- [contents](#contents)
- [weights](#weights)
- [ライセンス](#license)
- [プロジェクトへの貢献](#contributing)

## Usage

[action.yml](./action.yml)をご覧ください。

### Basic

```yaml
steps:
- uses: ddradar/choose-random-action@v1
id: act # output を参照するために必須
with:
contents: |
foo
bar
baz
weights: |
2
3
5
- name: Echo outputs
run: echo ${{ steps.act.outputs.selected }} # foo: 20%, bar: 30%, baz: 50%
```

### Use with [Post LGTM Image](https://github.com/ddradar/lgtm-action)

```yaml
name: Send LGTM Image
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
jobs:
post:
runs-on: ubuntu-latest
if: (!contains(github.actor, '[bot]')) # botのコメントを除く
steps:
- uses: ddradar/choose-random-action@v1
id: act
with:
contents: |
https://example.com/your-lgtm-image-1.jpg
https://example.com/your-lgtm-image-2.jpg
https://example.com/your-lgtm-image-3.jpg
- uses: ddradar/lgtm-action@v1
with:
image-url: ${{ steps.act.outputs.selected }}
```

## Options

### contents

*必須です。*

ランダムに選択したい文字列を指定します。

### weights

*オプション。*

選択肢に重み付けをしたい場合に指定します。
`contents`と同じ要素数にしてください。
未指定の場合は、すべての要素が同じ重み付けとなります。

## License

[MIT ライセンス](LICENSE)

## Contributing

[ガイド](CONTRIBUTING-ja.md)をご覧ください。
96 changes: 96 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Choose Random Action

[![last commit](https://img.shields.io/github/last-commit/ddradar/choose-random-action "last commit")](https://github.com/ddradar/choose-random-action/commits/main)
[![release version](https://img.shields.io/github/v/release/ddradar/choose-random-action?sort=semver "release version")](https://github.com/ddradar/choose-random-action/releases)
[![Node.js CI](https://github.com/ddradar/choose-random-action/actions/workflows/node.yml/badge.svg)](https://github.com/ddradar/choose-random-action/actions/workflows/node.yml)
[![codecov](https://codecov.io/gh/ddradar/choose-random-action/branch/main/graph/badge.svg?token=VfAjX7k1B4)](https://codecov.io/gh/ddradar/choose-random-action)
[![CodeFactor](https://www.codefactor.io/repository/github/ddradar/choose-random-action/badge)](https://www.codefactor.io/repository/github/ddradar/choose-random-action)
[![License](https://img.shields.io/github/license/ddradar/choose-random-action)](LICENSE)

日本語版のガイドは[こちら](./README-ja.md)です。

Choose one randomly from multiple user inputs

## TOC

- [Usage](#usage)
- [Basic](#basic)
- [Use with Post LGTM Image](#use-with-post-lgtm-image)
- [Options](#options)
- [contents](#contents)
- [weights](#weights)
- [License](#license)
- [Contributing](#contributing)

## Usage

See [action.yml](./action.yml)

### Basic

```yaml
steps:
- uses: ddradar/choose-random-action@v1
id: act # required to reference output
with:
contents: |
foo
bar
baz
weights: |
2
3
5
- name: Echo outputs
run: echo ${{ steps.act.outputs.selected }} # foo: 20%, bar: 30%, baz: 50%
```

### Use with [Post LGTM Image](https://github.com/ddradar/lgtm-action)

```yaml
name: Send LGTM Image
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
jobs:
post:
runs-on: ubuntu-latest
if: (!contains(github.actor, '[bot]')) # Exclude bot comment
steps:
- uses: ddradar/choose-random-action@v1
id: act
with:
contents: |
https://example.com/your-lgtm-image-1.jpg
https://example.com/your-lgtm-image-2.jpg
https://example.com/your-lgtm-image-3.jpg
- uses: ddradar/lgtm-action@v1
with:
image-url: ${{ steps.act.outputs.selected }}
```

## Options

### contents

*Required.*

String choices you want to choose randomly.

### weights

*Optional.*

Set natural integer if you want to weight the choices.
Make it the same length as the contents.
By default, all content has equal weight.

## License

[MIT License](LICENSE)

## Contributing

See [guide](./CONTRIBUTING.md).
22 changes: 22 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Choose Random Action'
description: 'Choose one randomly from multiple user inputs'
author: 'ddradar'
inputs:
contents:
description: 'String choices you want to choose randomly'
required: true
weights:
description: >
Set natural integer if you want to weight the choices.
Make it the same length as the contents.
By default, all content has equal weight.
required: false
outputs:
selected:
description: 'Selected string in contents'
branding:
icon: 'shuffle'
color: 'gray-dark'
runs:
using: 'node16'
main: 'dist/index.js'
1 change: 1 addition & 0 deletions dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 0d1be48

Please sign in to comment.