Skip to content

Commit

Permalink
Add the readme and license.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoichiro committed Feb 22, 2021
1 parent ef8ee0c commit e110cfa
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2021 Yoichiro Tanaka

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.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Increment a value GitHub Actions

This GitHub Actions increments a value written in a file specified by condition automatically.

# How to Use

If you have the `build-number.json` file below in the `foobar/baz` directory:

```text
{"buildNumber":3}
```

The example of the `increment.yaml` YAML file in the `.github/workflows` directory is the following:

```yaml
name: Increment value test
on:
push:
branches:
- main
jobs:
test:
name: Increment value test
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Increment value
uses: yoichiro/gh-action-increment-value@main
with:
target_directory: 'foobar/baz'
target_file: 'build_number.json'
prefix: 'buildNumber":'
suffix: '}'
commit_message: 'Increment the build number to '
```
* target_directory - The directory path where there is the target file.
* target_file - The target file name.
* prefix - The prefix string to determine the start position of the target number.
* suffix - The suffix string to determine the end position of the target number.
* commit_message - The commit message (automatically the number appended.).

0 comments on commit e110cfa

Please sign in to comment.