https://github.com/technote-space/get-git-comment-action
GitHub actions to get git comment.
https://github.com/technote-space/get-git-comment-action
github-actions
Last synced: 9 months ago
JSON representation
GitHub actions to get git comment.
- Host: GitHub
- URL: https://github.com/technote-space/get-git-comment-action
- Owner: technote-space
- License: mit
- Created: 2020-02-05T12:38:58.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-12-30T03:01:38.000Z (almost 2 years ago)
- Last Synced: 2025-04-04T14:54:54.059Z (9 months ago)
- Topics: github-actions
- Language: TypeScript
- Homepage:
- Size: 8.44 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.ja.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Get git comment action
[](https://github.com/technote-space/get-git-comment-action/actions)
[](https://codecov.io/gh/technote-space/get-git-comment-action)
[](https://www.codefactor.io/repository/github/technote-space/get-git-comment-action)
[](https://github.com/technote-space/get-git-comment-action/blob/main/LICENSE)
*Read this in other languages: [English](README.md), [日本語](README.ja.md).*
これは Git コメントを取得する `GitHub Actions` です。
## Table of Contents
Details
- [スクリーンショット](#%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)
- [Skip CI](#skip-ci)
- [Not skip CI](#not-skip-ci)
- [使用方法](#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)
- [出力](#%E5%87%BA%E5%8A%9B)
- [message](#message)
- [Why?](#why)
- [Author](#author)
## スクリーンショット
### Skip CI

### Not skip CI

## 使用方法
例:
```yaml
on:
pull_request:
push:
branches:
- main
tags:
- "!*"
name: CI
jobs:
eslint:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-git-comment-action@v1
- name: Install Package dependencies
run: yarn install
if: "! contains(env.COMMIT_MESSAGE, '[skip ci]') && ! contains(env.COMMIT_MESSAGE, '[ci skip]')"
- name: Check code style
run: yarn test
if: "! contains(env.COMMIT_MESSAGE, '[skip ci]') && ! contains(env.COMMIT_MESSAGE, '[ci skip]')"
```
## 出力
### message
#### if eventName == push
`payload.head_commit.message`
#### else
1. `git log --format=%B {{ sha }}`
例:
```
test1 test2
test3
```
1. 改行で分割
例:
```
['test1 test2', '', 'test3']
```
1. トリム及び空白行の削除
例:
```
['test1 test2', 'test3']
```
1. `SEPARATOR` オプションの値で結合
例:
```
test1 test2 test3
```
* sha
1. context.payload.pull_request.head.sha
1. context.payload.deployment.sha
1. context.sha
## Why?
`[ci skip]` を実現する方法として `head_commit.message` の紹介がよくありますが、もちろん pull_request イベントなどでは使用できません。
このアクションを使用することで push 以外でもコメントを取得することが可能になります。
## Author
[GitHub (Technote)](https://github.com/technote-space)
[Blog](https://technote.space)