Skip to content

Commit 1314497

Browse files
feat: add MAX_LINES input param (#40)
* Configurable max lines * docs: update usage info * chore: update build Co-authored-by: jamesgeorge007 <[email protected]>
1 parent de571a4 commit 1314497

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ Please note that only those public events that belong to the following list show
4444

4545
You can find an example [here](https://github.com/jamesgeorge007/jamesgeorge007/blob/master/.github/workflows/update-readme.yml).
4646

47-
### Custom commit message
47+
### Override defaults
48+
49+
Use the following `input params` to customize it for your use case:-
50+
51+
| Input Param | Default Value | Description |
52+
|--------|--------|--------|
53+
| `COMMIT_MSG` | :zap: Update README with the recent activity | Commit message used while committing to the repo |
54+
| `MAX_LINES` | 5 | The maximum number of lines populated in your readme file |
4855

49-
Specify a custom commit message with the `COMMIT_MSG` input param.
5056

5157
```yml
5258
name: Update README
@@ -68,6 +74,7 @@ jobs:
6874
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6975
with:
7076
COMMIT_MSG: 'Specify a custom commit message'
77+
MAX_LINES: 10
7178
```
7279

7380
_Inspired by [JasonEtco/activity-box](https://github.com/JasonEtco/activity-box)_

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ inputs:
1111
description: "Commit message used while committing to the repo"
1212
default: ":zap: Update README with the recent activity"
1313
required: false
14+
MAX_LINES:
15+
description: "The maximum number of lines populated in your readme file"
16+
default: 5
17+
required: false
1418

1519
branding:
1620
color: yellow

dist/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,11 +1479,10 @@ const path = __webpack_require__(622);
14791479
const { spawn } = __webpack_require__(129);
14801480
const { Toolkit } = __webpack_require__(461);
14811481

1482-
const MAX_LINES = 5;
1483-
14841482
// Get config
14851483
const GH_USERNAME = core.getInput("GH_USERNAME");
14861484
const COMMIT_MSG = core.getInput("COMMIT_MSG");
1485+
const MAX_LINES = core.getInput("MAX_LINES");
14871486
/**
14881487
* Returns the sentence case representation
14891488
* @param {String} str - the string

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ const path = require("path");
44
const { spawn } = require("child_process");
55
const { Toolkit } = require("actions-toolkit");
66

7-
const MAX_LINES = 5;
8-
97
// Get config
108
const GH_USERNAME = core.getInput("GH_USERNAME");
119
const COMMIT_MSG = core.getInput("COMMIT_MSG");
10+
const MAX_LINES = core.getInput("MAX_LINES");
1211
/**
1312
* Returns the sentence case representation
1413
* @param {String} str - the string

0 commit comments

Comments
 (0)