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

Add ability to set default BASE_SHA instead of using HEAD~1 if no successful workflow run found #97

Closed
Mufasa opened this issue Jul 21, 2023 · 3 comments · Fixed by #152
Labels
feature New feature or request good first issue Good for newcomers

Comments

@Mufasa
Copy link

Mufasa commented Jul 21, 2023

The current action sets the BASE_SHA to HEAD~1 if it cannot find a successful workflow run. In my specific case, I created a monorepo and checked-in several commits before I got something that could be built successfully.

It would be great if I could either configure this action to use the first commit as the BASE_SHA or specify a default BASE_SHA myself.

Would this be possible?

@Mufasa
Copy link
Author

Mufasa commented Jul 21, 2023

An alternative might be to also set an environment variable, say LAST_SUCCESSFUL_WORKFLOW_FOUND, to either yes or no (or true/false). We could then use this to reset the BASE_SHA environment variable to whatever SHA we wanted under these conditions.

@meeroslav meeroslav added feature New feature or request good first issue Good for newcomers labels Sep 6, 2023
@meeroslav
Copy link
Collaborator

You can propose a new PR that would introduce a new variable:

fallback_sha: ''

When specified, this would be used as a fallback instead of the HEAD~1

@jmvtrinidad
Copy link

jmvtrinidad commented Dec 13, 2023

This would be useful also in use case where the 2nd workflow(triggered by workflow_dispatch from 1st workflow) want to check the affected projects from the previous workflow. Currently 2nd workflow always see same sha for both env.
Instead of fallback_sha, can we have base_sha?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants