Skip to content

Commit

Permalink
chore: change access_token to optional (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Sep 30, 2022
1 parent 384c570 commit 7472485
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -21,8 +21,6 @@ jobs:
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.10.0
with:
access_token: ${{ github.token }}
#- name: Run Tests
# uses: actions/setup-node@v1
# run: node test.js
Expand All @@ -48,7 +46,6 @@ jobs:
- uses: styfle/cancel-workflow-action@0.10.0
with:
workflow_id: 479426
access_token: ${{ github.token }}
```

- _Note_: `workflow_id` can be a Workflow ID (number) or Workflow File Name (string)
Expand Down Expand Up @@ -119,7 +116,6 @@ jobs:
- uses: styfle/cancel-workflow-action@0.10.0
with:
all_but_latest: true
access_token: ${{ github.token }}
```

### Advanced: Token Permissions
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Expand Up @@ -14,8 +14,8 @@ inputs:
default: 'false'
access_token:
description: 'Your GitHub Access Token, defaults to: {{ github.token }}'
default: '${{ github.token }}'
required: true
default: ${{ github.token }}
required: false
all_but_latest:
description: "Cancel all actions but the last one"
required: false
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -30,7 +30,7 @@ async function main() {
}

console.log({ eventName, sha, headSha, branch, owner, repo, GITHUB_RUN_ID });
const token = core.getInput('access_token', { required: true });
const token = core.getInput('access_token');
const workflow_id = core.getInput('workflow_id', { required: false });
const ignore_sha = core.getBooleanInput('ignore_sha', { required: false });
const all_but_latest = core.getBooleanInput('all_but_latest', { required: false });
Expand Down

0 comments on commit 7472485

Please sign in to comment.