Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Less inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy McKay committed Jan 27, 2020
1 parent 8dcb2d9 commit 8f8510d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ This Action uses the [GitHub API](https://developer.github.com/v3/actions/workfl
```
- name: cancelling
uses: andymckay/cancel-action@master
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
```

The cancellation might take a few seconds to process, this is most useful when you'd like to cancel a long running build. In combination with the `if` statement, this allows you to cancel the build conditionally.
6 changes: 2 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ description: 'Uses the GitHub Actions API to cancel the build'
inputs:
token:
description: 'Token'
required: true
repository:
description: 'Repository'
required: true
required: false
default: ${{ github.token }}
runs:
using: 'node12'
main: 'cancel.js'
Expand Down
2 changes: 1 addition & 1 deletion cancel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const https = require('https');
const options = {
hostname: 'api.github.com',
path: `/repos/${process.env.INPUT_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/cancel`,
path: `/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/cancel`,
headers: {
'Authorization': `token ${process.env.INPUT_TOKEN}`,
'Content-Type': 'application/json',
Expand Down

0 comments on commit 8f8510d

Please sign in to comment.