step-security/Nx set SHAs
Derives SHAs for base and head for use in nx affected commands, optionally setting them as env variables for the current job
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| gh-token | The GitHub token used to perform git operations | — | ${{ github.token }} |
| main-branch-name | The name of the main branch in your repo, used as the target of PRs. E.g. main, master etc | — | main |
| remote | The name of the remote to fetch from | — | origin |
| set-environment-variables-for-job | Applies the derived SHAs for base and head as NX_BASE and NX_HEAD environment variables within the current Job | — | true |
| error-on-no-successful-workflow | By default, if no successful workflow is found on the main branch to determine the SHA, we will log a warning and use HEAD~1. Enable this option to error and exit instead. | — | false |
| fallback-sha | Fallback SHA to use if no successful workflow run is found. | no | "" |
| last-successful-event | The type of event to check for the last successful commit corresponding to that workflow-id, e.g. push, pull_request, release etc | — | push |
| working-directory | The directory where your repository is located | — | . |
| workflow-id | The ID of the workflow to track or name of the file name. E.g. ci.yml. Defaults to current workflow | — | — |
| use-previous-merge-group-commit | When using merge-group, use the previous commit in the group as the base SHA | — | true |
Outputs
| name | description |
|---|---|
| base | The value intended for use with --base or NX_BASE in all subsequent `nx affected` commands within the current workflow |
| head | The value intended for use with --head or NX_HEAD in all subsequent `nx affected` commands within the current workflow |
| noPreviousBuild | Used to check if a previous run was found in order to perform additional logic later on in your workflow, the only possible values is the string 'true', otherwise it won't be set |