Skip to content

Commit

Permalink
Update version & remove reference to 'latest' in docs [#169931786] (#22)
Browse files Browse the repository at this point in the history
* Use @master instead of latest

* update action docs

* 2.3.0

* /pr-lint/pivotal-lint/s

* pr space lint
  • Loading branch information
rheaditi authored Nov 25, 2019
1 parent 6d5aa03 commit de02fed
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 31 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<!-- toc -->

- [Installation](#installation)
- [Semantic Versions](#semantic-versions)
- [Features](#features)
- [PR Status Checks](#pr-status-checks)
- [PR Description & Labels](#pr-description--labels)
Expand All @@ -16,7 +17,6 @@
- [Soft-validations via comments](#soft-validations-via-comments)
- [Options](#options)
- [Skipping branches](#skipping-branches)
- [Semantic Versions](#semantic-versions)
- [Contributing](#contributing)
- [FAQ](#faq)

Expand All @@ -33,7 +33,7 @@ name: pivotal-lint
pivotal-lint:
runs-on: ubuntu-latest
steps:
- uses: cleartax/pivotal-lint@latest
- uses: cleartax/pivotal-lint@master
name: pivotal-lint
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -45,6 +45,20 @@ name: pivotal-lint
It can also be used as part of an existing workflow by adding it as a step. More information about the [options here](#options).
### Semantic Versions
If you want more stability in versions of `pivotal-lint` than `@master` you can also use the [semantic releases for pivotal-lint](https://github.com/cleartax/pivotal-lint/releases).

Example:

```yaml
# ...
steps:
- uses: cleartax/pivotal-lint@v2.3.0
name: pivotal-lint
# ...
```

## Features

### PR Status Checks
Expand Down Expand Up @@ -112,10 +126,10 @@ When a PR passes the above check, `pivotal-lint` will also add the story details
| key | description | required | default |
| --------------- | ------------------------------------------------------------------------------------------------ | -------- | ------- |
| `github-token` | Token used to update PR description. `GITHUB_TOKEN` is already available [when you use GitHub actions](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token#about-the-github_token-secret), so all that is required is to pass it as a param here. | true | null |
| `pivotal-token` | API Token used to fetch Pivotal Story information. Must have read access to your Pivotal boards. Check [here](https://www.pivotaltracker.com/help/articles/api_token/) on how to get a Pivotal API Token| true | null |
| `skip-branches` | A regex to ignore running PR lint on certain branches, like production etc. | false | ' ' |
| `skip-comments` | A `Boolean` if set to `true` PR lint will skip adding lint comments for PR title. | false | false |
| `pr-threshold` | An `Integer` based on which PR lint will add commets for a huge PR. | false | 800 |
| `pivotal-token` | API Token used to fetch Pivotal Story information. Must have read access to your PivotalTracker projects. Check [here](https://www.pivotaltracker.com/help/articles/api_token/) on how to get a Pivotal API Token| true | null |
| `skip-branches` | A regex to ignore running `pivotal-lint` on certain branches, like production etc. | false | ' ' |
| `skip-comments` | A `Boolean` if set to `true` `pivotal-lint` will skip adding lint comments for PR title. | false | false |
| `pr-threshold` | An `Integer` based on which `pivotal-lint` will add a comment discouraging huge PRs. | false | 800 |

Since tokens are private, we suggest adding them as [GitHub secrets](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables).

Expand All @@ -125,20 +139,6 @@ Since GitHub actions take string inputs, `skip-branches` must be a regex which w

`pivotal-lint` already skips PRs which are filed by bots (for eg. [dependabot](https://github.com/marketplace/dependabot-preview)). You can add more bots to [this list](https://github.com/cleartax/pivotal-lint/blob/2bb72327ef04ab028caf84a099ffbc08b4dd0959/src/constants.ts#L4-L6), or add the branch-format followed by the bot PRs to the `skip-branches` option.

### Semantic Versions

If you want more stability in versions of `pivotal-lint` than `@latest` you can also use the [semantic releases for pivotal-lint](https://github.com/cleartax/pivotal-lint/releases).

Example:

```yaml
# ...
steps:
- uses: cleartax/pivotal-lint@v2.1.0
name: pivotal-lint
# ...
```

## Contributing

Follow the instructions [here](https://help.github.com/en/articles/creating-a-javascript-action#commit-and-push-your-action-to-github) to know more about GitHub actions.
Expand Down
2 changes: 1 addition & 1 deletion __tests__/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('shouldUpdatePRDescription()', () => {
<br />
</details>
<!--
do not remove this marker as it will break PR-lint's functionality.
do not remove this marker as it will break pivotal-lint's functionality.
${HIDDEN_MARKER}
-->
Expand Down
12 changes: 9 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ description: 'Add pivotal story details to pull requests'
author: 'cleartax'
inputs:
github-token:
description: Token used to update PR description. Must have write access to your repository.
description: 'Token used to update PR description and add labels. Can be passed in using {{ secrets.GITHUB_TOKEN }}'
required: true
pivotal-token:
description: API Token used to fetch Pivotal Story information. Must have read access to your Pivotal boards.
description: 'API Token used to fetch Pivotal Story information. Must have read access to your PivotalTracker Projects.'
required: true
skip-branches:
description: A regex to ignore running PR lint on certain branches
description: 'A regex to ignore running on certain branches, like production etc.'
required: false
default: ''
skip-comments: 'A boolean if set to true, will skip adding lint comments for PR title.'
required: false
default: false
pr-threshold: 'An `Integer` based on which pivotal-lint add a comment discouraging huge PRs. Is disabled by `skip-comments`'
required: false
default: 800
runs:
using: 'node12'
main: 'lib/index.js'
Expand Down
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2325,7 +2325,7 @@ function run() {
// github client with given token
const client = new github.GitHub(GITHUB_TOKEN);
if (!headBranch && !baseBranch) {
const commentBody = 'pr-lint is unable to determine the head and base branch';
const commentBody = 'pivotal-lint is unable to determine the head and base branch';
const comment = Object.assign(Object.assign({}, commonPayload), { body: commentBody });
yield utils_1.addComment(client, comment);
core.setFailed('Unable to get the head and base branch');
Expand Down Expand Up @@ -2970,7 +2970,7 @@ exports.getPrDescription = (body = '', story) => {
<p>${description || 'Oops, the story creator did not add any description.'}</p>
</details>
<!--
do not remove this marker as it will break pr-lint's functionality.
do not remove this marker as it will break pivotal-lint's functionality.
${constants_1.HIDDEN_MARKER}
-->

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pivotal-lint",
"version": "2.2.1",
"version": "2.3.0",
"description": "Add pivotal story details to pull requests",
"main": "lib/index.js",
"scripts": {
Expand All @@ -11,7 +11,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/cleartax/pr-lint"
"url": "git+https://github.com/cleartax/pivotal-lint"
},
"keywords": [
"actions",
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async function run() {
const client: github.GitHub = new github.GitHub(GITHUB_TOKEN);

if (!headBranch && !baseBranch) {
const commentBody = 'pr-lint is unable to determine the head and base branch';
const commentBody = 'pivotal-lint is unable to determine the head and base branch';
const comment: IssuesCreateCommentParams = {
...commonPayload,
body: commentBody,
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export const getPrDescription = (body: string = '', story: PivotalStory): string
<p>${description || 'Oops, the story creator did not add any description.'}</p>
</details>
<!--
do not remove this marker as it will break pr-lint's functionality.
do not remove this marker as it will break pivotal-lint's functionality.
${HIDDEN_MARKER}
-->
Expand Down

0 comments on commit de02fed

Please sign in to comment.