diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c9050f..11fe1f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,19 +19,19 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FIRST_ISSUE: > - Hi 👋 @${author} - + Hi 👋 @{{ author }} + Thanks for opening your first issue here! Be sure to follow the issue template! - + FIRST_PR: > - 👋 @${author} - + 👋 @{{ author }} + Thanks for opening this pull request! Please check out our contributing guidelines. - + FIRST_PR_MERGED: > - 🎉 @${author} - + 🎉 @{{ author }} + Congrats on merging your first pull request! We here at behaviorbot are proud of you! - + diff --git a/README.md b/README.md index 00637ad..c4dc41a 100644 --- a/README.md +++ b/README.md @@ -19,19 +19,19 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FIRST_ISSUE: > - 👋 @${author} + 👋 @{{ author }} Thanks for opening your first issue here! Be sure to follow the issue template! FIRST_PR: > - 👋 @${author} + 👋 @{{ author }} Thanks for opening this pull request! Please check out our contributing guidelines. FIRST_PR_MERGED: > - 🎉 @${author} + 🎉 @{{ author }} Congrats on merging your first pull request! We here at behaviorbot are proud of you! ``` @@ -47,6 +47,7 @@ jobs: - `FIRST_PR_MERGED_REACTIONS`: Reactions to be add to comment on pull requests merged by a first time user. Available reactions: + - `+1` 👍 - `-1` 👎 - `laugh` 😄 @@ -74,7 +75,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FIRST_ISSUE_REACTIONS: '+1, hooray, rocket, heart' FIRST_ISSUE_COMMENT: > - 👋 @${author} + 👋 @{{ author }} Thanks for opening your first issue here! Be sure to follow the issue template! ``` @@ -95,7 +96,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FIRST_PR_REACTIONS: '+1, hooray, rocket, heart' FIRST_PR_COMMENT: > - 👋 @${author} + 👋 @{{ author }} Thanks for opening this pull request! Please check out our contributing guidelines. ``` diff --git a/package.json b/package.json index 9255acb..160776c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "welcome-action", - "version": "1.0.1", + "version": "1.0.2", "description": "GitHub action to give a welcome comment on first issue or PR 💖", "main": "dist/index.js", "files": [ @@ -40,13 +40,13 @@ "@actions/core": "^1.2.6", "@actions/github": "^4.0.0", "lodash.random": "^3.2.0", - "lodash.template": "^4.5.0" + "mustache": "^4.0.1" }, "devDependencies": { "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0", "@types/lodash.random": "^3.2.6", - "@types/lodash.template": "^4.5.0", + "@types/mustache": "^4.0.1", "@types/node": "^14.0.27", "@typescript-eslint/eslint-plugin": "^4.1.1", "@typescript-eslint/parser": "^4.1.1", diff --git a/src/util.ts b/src/util.ts index 7ad267a..5d135a8 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,5 +1,5 @@ +import mustache from 'mustache' import random from 'lodash.random' -import template from 'lodash.template' import * as core from '@actions/core' import * as github from '@actions/github' @@ -16,7 +16,7 @@ export namespace Util { result = comment[pos] || comment[0] } - return args ? template(result)(args) : result + return args ? mustache.render(result, args) : result } export function isValidEvent(event: string, action?: string) { diff --git a/yarn.lock b/yarn.lock index 4925611..eecc1eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -365,6 +365,11 @@ resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz#69a23a3ad29caf0097f06eda59b361ee2f0639f6" integrity sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY= +"@types/mustache@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@types/mustache/-/mustache-4.0.1.tgz#e4d421ed2d06d463b120621774185a5cd1b92d77" + integrity sha512-wH6Tu9mbiOt0n5EvdoWy0VGQaJMHfLIxY/6wS0xLC7CV1taM6gESEzcYy0ZlWvxxiiljYvfDIvz4hHbUUDRlhw== + "@types/node@>= 8", "@types/node@^14.0.27": version "14.11.2" resolved "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz#2de1ed6670439387da1c9f549a2ade2b0a799256" @@ -1795,6 +1800,11 @@ multimatch@^4.0.0: arrify "^2.0.1" minimatch "^3.0.4" +mustache@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/mustache/-/mustache-4.0.1.tgz#d99beb031701ad433338e7ea65e0489416c854a2" + integrity sha512-yL5VE97+OXn4+Er3THSmTdCFCtx5hHWzrolvH+JObZnUYwuaG7XV+Ch4fR2cIrcYI0tFHxS7iyFYl14bW8y2sA== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"