Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change access_token to optional #72

Merged
merged 6 commits into from Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions action.yml
Expand Up @@ -14,11 +14,11 @@ inputs:
default: false
access_token:
description: 'Your GitHub Access Token, defaults to: {{ github.token }}'
default: '${{ github.token }}'
required: true
default: ${{ github.token }}
required: false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has a default value

Copy link
Owner

@styfle styfle Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the required prop in index.ts?

const token = core.getInput('access_token', { required: true });

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@styfle Should it be deleted?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. Are either of these required props causing problems?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're not causing any problems to me, but I saw it's set to required although it has a default value so that's why I created this PR

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If its not causing problems, lets not change it 🙂

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would argue that it also implies that the docs can be simplified, if this works without passing the default.

all_but_latest:
description: "Cancel all actions but the last one"
required: false
runs:
using: 'node12'
using: 'node14'
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
main: 'dist/index.js'
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');
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
const workflow_id = core.getInput('workflow_id', { required: false });
const ignore_sha = core.getInput('ignore_sha', { required: false }) === 'true';
const all_but_latest = core.getInput('all_but_latest', { required: false });
Expand Down