Skip to content

Commit

Permalink
Configurable max lines
Browse files Browse the repository at this point in the history
  • Loading branch information
panosru committed Oct 20, 2020
1 parent de571a4 commit 3fe2dd3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ 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
### Custom commit message or custom maximum number of populated lines

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

Specify a custom maximum number of lines with the `MAX_LINES` input param *(default is 5)*.

```yml
name: Update README

Expand All @@ -68,6 +70,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 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 3fe2dd3

Please sign in to comment.