From 1314497c1d5c54d1fc01d9b94cb7c1c5436ffed6 Mon Sep 17 00:00:00 2001 From: Panagiotis <400362+panosru@users.noreply.github.com> Date: Sat, 21 Nov 2020 10:16:32 +0200 Subject: [PATCH] feat: add MAX_LINES input param (#40) * Configurable max lines * docs: update usage info * chore: update build Co-authored-by: jamesgeorge007 --- README.md | 11 +++++++++-- action.yml | 4 ++++ dist/index.js | 3 +-- index.js | 3 +-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5eaf816..a3969af 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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)_ diff --git a/action.yml b/action.yml index d5bf20e..86d2611 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/dist/index.js b/dist/index.js index c977f97..cd39cdd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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 diff --git a/index.js b/index.js index bcbfa7f..e1fff70 100644 --- a/index.js +++ b/index.js @@ -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