Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ This action requires the `write` permission for the [`permissions.pull-requests`
| base-stats-json-path | The path to the base stats.json file | true | string |
| github-token | The Github token | true | string |
| title | An optional addition to the title, which also helps key comments, useful if running more than 1 copy of this action | false | string |

| describe-assets | Option for asset description output. One of "all" (default), "changed-only", or "none". | false | string |
| describe-assets | Option for asset description output. One of "all" (default), "changed-only", or "none". | false | string |
| issue-number | The issue to comment on (Default: The issue that triggered the action) | true | string |

## Example PR Comment

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
base-stats-json-path:
description: 'The path to the base stats.json file'
required: true
issue-number:
description: 'The issue number'
required: true
default: ${{ github.event.issue.number || github.event.workflow_run.pull_requests[0].number }}
github-token:
description: 'The Github token'
required: true
Expand Down
7 changes: 2 additions & 5 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,10 @@ export function getDescribeAssetsOptions(

async function run(): Promise<void> {
try {
if (
context.eventName !== 'pull_request' &&
context.eventName !== 'pull_request_target'
) {
throw new Error(
'This action only supports pull_request and pull_request_target events'
)
}
const {
issue: {number: issue_number},
repo: {owner, repo: repo_name}
} = context
const issue_number = parseInt(core.getInput('issue-number'))
const token = core.getInput('github-token')
const currentStatsJsonPath = core.getInput('current-stats-json-path')
const baseStatsJsonPath = core.getInput('base-stats-json-path')
Expand Down
Loading