Skip to content

Add output for commited changes#3

Open
Daniel Miranda (danielkza) wants to merge 1 commit intocloudposse:mainfrom
danielkza:add-commit-output
Open

Add output for commited changes#3
Daniel Miranda (danielkza) wants to merge 1 commit intocloudposse:mainfrom
danielkza:add-commit-output

Conversation

@danielkza
Copy link
Copy Markdown

@danielkza Daniel Miranda (danielkza) commented Apr 28, 2022

This allows stopping following steps if pre-commit found an issue that was auto-fixed.

Comment thread index.js
await exec.exec('git', ['checkout', 'HEAD', '-B', branch]);

await exec.exec('git', ['commit', '-am', git_commit_message]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change

Comment thread index.js

await exec.exec('git', ['commit', '-am', git_commit_message]);


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change

Comment thread index.js
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change

Comment thread index.js
}
} else {
core.setOutput('committed', '');
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can remove those else blocks and reduce the 3 core.submit lines to a single one

Suggested change
}
}
core.setOutput('committed', sha);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You would have to set let sha = '' earlier before line 84

@nitrocode
Copy link
Copy Markdown
Member

How does outputting the commit allow stopping following steps?

@danielkza
Copy link
Copy Markdown
Author

RB (@nitrocode) I just fail the build if commited is non-empty.

@hans-d Hans Donner (hans-d) added the stale This PR has gone stale label Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale This PR has gone stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants