Skip to content

Commit

Permalink
feat: add MAX_LINES input param (#40)
Browse files Browse the repository at this point in the history
* Configurable max lines

* docs: update usage info

* chore: update build

Co-authored-by: jamesgeorge007 <[email protected]>
  • Loading branch information
panosru and jamesgeorge007 authored Nov 21, 2020
1 parent de571a4 commit 1314497
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ Please note that only those public events that belong to the following list show

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

### Custom commit message
### Override defaults

Use the following `input params` to customize it for your use case:-

| Input Param | Default Value | Description |
|--------|--------|--------|
| `COMMIT_MSG` | :zap: Update README with the recent activity | Commit message used while committing to the repo |
| `MAX_LINES` | 5 | The maximum number of lines populated in your readme file |

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

```yml
name: Update README
Expand All @@ -68,6 +74,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
COMMIT_MSG: 'Specify a custom commit message'
MAX_LINES: 10
```

_Inspired by [JasonEtco/activity-box](https://github.com/JasonEtco/activity-box)_
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
description: "Commit message used while committing to the repo"
default: ":zap: Update README with the recent activity"
required: false
MAX_LINES:
description: "The maximum number of lines populated in your readme file"
default: 5
required: false

branding:
color: yellow
Expand Down
3 changes: 1 addition & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1479,11 +1479,10 @@ const path = __webpack_require__(622);
const { spawn } = __webpack_require__(129);
const { Toolkit } = __webpack_require__(461);

const MAX_LINES = 5;

// Get config
const GH_USERNAME = core.getInput("GH_USERNAME");
const COMMIT_MSG = core.getInput("COMMIT_MSG");
const MAX_LINES = core.getInput("MAX_LINES");
/**
* Returns the sentence case representation
* @param {String} str - the string
Expand Down
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ const path = require("path");
const { spawn } = require("child_process");
const { Toolkit } = require("actions-toolkit");

const MAX_LINES = 5;

// Get config
const GH_USERNAME = core.getInput("GH_USERNAME");
const COMMIT_MSG = core.getInput("COMMIT_MSG");
const MAX_LINES = core.getInput("MAX_LINES");
/**
* Returns the sentence case representation
* @param {String} str - the string
Expand Down

0 comments on commit 1314497

Please sign in to comment.