Skip to content

Commit e110cfa

Browse files
committed
Add the readme and license.
1 parent ef8ee0c commit e110cfa

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2021 Yoichiro Tanaka
2+
3+
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:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
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.

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Increment a value GitHub Actions
2+
3+
This GitHub Actions increments a value written in a file specified by condition automatically.
4+
5+
# How to Use
6+
7+
If you have the `build-number.json` file below in the `foobar/baz` directory:
8+
9+
```text
10+
{"buildNumber":3}
11+
```
12+
13+
The example of the `increment.yaml` YAML file in the `.github/workflows` directory is the following:
14+
15+
```yaml
16+
name: Increment value test
17+
on:
18+
push:
19+
branches:
20+
- main
21+
jobs:
22+
test:
23+
name: Increment value test
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Check out source code
27+
uses: actions/checkout@v2
28+
with:
29+
ref: ${{ github.ref }}
30+
- name: Increment value
31+
uses: yoichiro/gh-action-increment-value@main
32+
with:
33+
target_directory: 'foobar/baz'
34+
target_file: 'build_number.json'
35+
prefix: 'buildNumber":'
36+
suffix: '}'
37+
commit_message: 'Increment the build number to '
38+
```
39+
40+
* target_directory - The directory path where there is the target file.
41+
* target_file - The target file name.
42+
* prefix - The prefix string to determine the start position of the target number.
43+
* suffix - The suffix string to determine the end position of the target number.
44+
* commit_message - The commit message (automatically the number appended.).

0 commit comments

Comments
 (0)