-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add options to load the action from a specific repo/ref #77
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
base: main
Are you sure you want to change the base?
Conversation
| type: string | ||
|
|
||
| action-repository: | ||
| description: "Repository to load the actions from" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why would we want the repository to be overrideable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of forks. I've used it to test this very PR
|
|
||
| action-ref: | ||
| description: "Git ref to load the actions from" | ||
| default: ${{ github.ref || 'v0.1.10' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a version script at the root that used to update this version during npm version: https://github.com/pkgjs/action/blob/main/package.json#L9 - not sure what's the best approach for it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, when would github.ref not be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, when would
github.refnot be set?
As the docs say: This is only set if a branch or tag is available for the event type.
From my own testing, workflow_call leaves this undefined, although couldn't find where that's defined in the docs.
|
|
||
| action-repository: | ||
| description: "Repository to load the actions from" | ||
| default: ${{ github.repository || 'pkgs/action' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does github.repository refer to here? Would that not be the repository that sets uses: pkgjs/action, i.e. it will always try to check out the local copy (which probably won't exist), rather than the pkgjs/action itself?
I could be misinterpreting this, of course.
Additionally, when would github.repository not be set at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does
github.repositoryrefer to here?
On workflow_call: it's undefined. Otherwise, it's the name of the repo, as you can see in https://github.com/aduh95/action/actions/runs/15821306998, it takes the name of the fork.
See https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#using-third-party-actions
Tested with https://github.com/nodejs/node-core-utils/actions/runs/15667322080/job/44133183235
It allows to use the action from a fork / on a specific commit. It shouldn't be a breaking change as the default is left unchanged.