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

feature: add support for commit input (fixes #1634) #1858

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

testersen
Copy link

@testersen testersen commented Aug 20, 2024

Fixes #1634

This pull request adds support for supplying a commit input. This is necessary in order to replicate the standard behavior in pull request synchronization events when not using the default values.

Commit Summary
650ceb0 Adds a commit input in the action.yaml file
67b5caa In the input-helper file, before settings.ref is checked and assigned default values, set settings.commit to equal the inputs.commit.
8a241b5 In the input-helper file, change settings.ref = core.getInput('ref') to settings.ref = core.getInput('ref') ?? settings.ref as a fallback for when the commit input was specified, but not the ref input.
267ca9c Before making settings.ref fallback to settings.commit, validate that the settings.commit, if defined, has the format of a full SHA sum.
3a6c8fb Added tests to verify the behavior of implementation in this pull request.
491fae0 Result of running npm run format
a52fa92 1be0f94 Result of running npm run build
0865c4b In input-helper, change the settings.ref fallback from using ?? to ||, becuase settings.ref might be an empty string or null, causing ?? to not have the desired effect. Also updated the test to reflect the fallback behavior.

@testersen testersen changed the title feature: add support for commit input feature: add support for commit input (fixed #1634) Aug 21, 2024
@testersen testersen changed the title feature: add support for commit input (fixed #1634) feature: add support for commit input (fixes #1634) Aug 21, 2024
@testersen
Copy link
Author

cc @joshmgross - we @TelenorNorgeInternal were hoping to get this merged soon ™️ would you by any chance have time to review sometime before September? Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checkout action with branch as ref not consistent through workflow
1 participant