Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
feat: Build for release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 18, 2020
1 parent 2aabd61 commit 0205a15
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 16 deletions.
34 changes: 24 additions & 10 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
id: git-diff
# id: git-diff
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PREFIX_FILTER: |
Expand All @@ -58,11 +58,14 @@ jobs:
SUFFIX_FILTER: .ts
- name: Install Package dependencies
run: yarn install
if: steps.git-diff.outputs.diff
# if: steps.git-diff.outputs.diff
if: env.GIT_DIFF
- name: Check code style
# 差分があるソースコードだけチェック
run: yarn eslint ${{ steps.git-diff.outputs.diff }}
if: steps.git-diff.outputs.diff
# run: yarn eslint ${{ steps.git-diff.outputs.diff }}
run: yarn eslint ${{ env.GIT_DIFF }}
# if: steps.git-diff.outputs.diff
if: env.GIT_DIFF
```
以下のソースコードに差分がない場合、この Workflow はコードのスタイルチェックをスキップします。
Expand All @@ -73,7 +76,7 @@ jobs:
1. `git diff` を取得

```shell script
git diff "${FROM}"${DOT}"${TO}" '--diff-filter=${DIFF_FILTER}' --name-only
git diff ${FROM}${DOT}${TO} '--diff-filter=${DIFF_FILTER}' --name-only
```

例:(default)
Expand All @@ -83,7 +86,7 @@ jobs:
```
=>
```shell script
git diff "origin/${GITHUB_BASE_REF}"..."${GITHUB_REF#refs/}" '--diff-filter=AM' --name-only
git diff ${FROM}...${TO} '--diff-filter=AM' --name-only
```
=>
```
Expand All @@ -94,6 +97,8 @@ jobs:
src/utils/command.ts
yarn.lock
```
[${FROM}, ${TO}](#from-to)
1. `PREFIX_FILTER` や `SUFFIX_FILTER` オプションによるフィルタ
Expand All @@ -108,17 +113,17 @@ jobs:
src/utils/command.ts
```

1. `ABSOLUTE` オプションがtrue(default)の場合に絶対パスに変換
1. `ABSOLUTE` オプションがtrue場合に絶対パスに変換 (default: false)

例:(default)
例:
```
/home/runner/work/my-repo-name/my-repo-name/src/main.ts
/home/runner/work/my-repo-name/my-repo-name/src/utils/command.ts
```

1. `SEPARATOR` オプションの値で結合

例:
例:(default: false)
```yaml
SEPARATOR: ' '
```
Expand Down Expand Up @@ -154,10 +159,19 @@ default: `SET_ENV_NAME_LINES=`
| eventName | action |
|:---:|:---:|
|pull_request|opened, reopened, rerequested, synchronize|
|pull_request|*|
|push|*|

もしこれ以外のイベントで呼ばれた場合、結果は空になります。

## 補足
### FROM, TO
| condition | FROM | TO |
|:---:|:---:|:---:|
| tag push |x|x|
| pull request (not default branch) | base ref (e.g. master) | merge ref (e.g. refs/pull/123/merge) |
| payload.before = '000...000' | default branch (e.g. master) | payload.after |
| else | payload.before | payload.after |

## Author
[GitHub (Technote)](https://github.com/technote-space)
[Blog](https://technote.space)
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v1
# id: git-diff
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PREFIX_FILTER: |
Expand All @@ -57,10 +58,13 @@ jobs:
SUFFIX_FILTER: .ts
- name: Install Package dependencies
run: yarn install
# if: steps.git-diff.outputs.diff
if: env.GIT_DIFF
- name: Check code style
# Check only the source codes that have differences
# run: yarn eslint ${{ steps.git-diff.outputs.diff }}
run: yarn eslint ${{ env.GIT_DIFF }}
# if: steps.git-diff.outputs.diff
if: env.GIT_DIFF
```
Expand All @@ -72,7 +76,7 @@ If there is no difference in the source code below, this workflow will skip the
1. Get git diff

```shell script
git diff "${FROM}"${DOT}"${TO}" '--diff-filter=${DIFF_FILTER}' --name-only
git diff ${FROM}${DOT}${TO} '--diff-filter=${DIFF_FILTER}' --name-only
```

e.g. (default)
Expand All @@ -82,7 +86,7 @@ If there is no difference in the source code below, this workflow will skip the
```
=>
```shell script
git diff "origin/${GITHUB_BASE_REF}"..."${GITHUB_REF#refs/}" '--diff-filter=AM' --name-only
git diff ${FROM}...${TO} '--diff-filter=AM' --name-only
```
=>
```
Expand All @@ -93,6 +97,8 @@ If there is no difference in the source code below, this workflow will skip the
src/utils/command.ts
yarn.lock
```
[${FROM}, ${TO}](#from-to)
1. Filtered by `PREFIX_FILTER` or `SUFFIX_FILTER` option
Expand All @@ -107,17 +113,17 @@ If there is no difference in the source code below, this workflow will skip the
src/utils/command.ts
```

1. Mapped to absolute if `ABSOLUTE` option is true(default)
1. Mapped to absolute if `ABSOLUTE` option is true (default: false)

e.g. (default)
e.g.
```
/home/runner/work/my-repo-name/my-repo-name/src/main.ts
/home/runner/work/my-repo-name/my-repo-name/src/utils/command.ts
```

1. Combined by `SEPARATOR` option

e.g.
e.g. (default)
```yaml
SEPARATOR: ' '
```
Expand Down Expand Up @@ -157,6 +163,15 @@ default: `SET_ENV_NAME_LINES=`

If called on any other event, the result will be empty.

## Addition
### FROM, TO
| condition | FROM | TO |
|:---:|:---:|:---:|
| tag push |x|x|
| pull request (not default branch) | base ref (e.g. master) | merge ref (e.g. refs/pull/123/merge) |
| payload.before = '000...000' | default branch (e.g. master) | payload.after |
| else | payload.before | payload.after |

## Author
[GitHub (Technote)](https://github.com/technote-space)
[Blog](https://technote.space)
2 changes: 1 addition & 1 deletion build.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"owner":"technote-space","repo":"get-diff-action","sha":"c05e1b89edb902368c01e5192d038eaee79294fe","ref":"refs/tags/test/v1.1.7.1","tagName":"test/v1.1.7.1","branch":"gh-actions","tags":["test/v1.1.7.1","test/v1.1.7","test/v1.1","test/v1"],"updated_at":"2020-02-18T13:46:42.184Z"}
{"owner":"technote-space","repo":"get-diff-action","sha":"4bddc584879f39579ba920a4248429b00867d531","ref":"refs/tags/v1.1.7","tagName":"v1.1.7","branch":"gh-actions","tags":["v1.1.7","v1.1","v1"],"updated_at":"2020-02-18T14:26:44.893Z"}

0 comments on commit 0205a15

Please sign in to comment.