app
app copied to clipboard
Make it possible to run probot-settings as a GitHub Action
This PR makes it possible to run probot-settings as a GitHub Action.
If run from a GitHub action, the commit payload lacks the modified
and added
properties, see:
https://github.blog/changelog/2019-10-16-changes-in-github-actions-push-event-payload/
This code now explicitly tests for these properties. If we have them (as if we were run as a typical Probot app), the code logic is unchanged.
But if these properties are missing — as in the case if we are run from an action — then act as if settings.yml has changed.
This makes it possible to run probot-settings from an action like this one: https://github.com/elstudio/actions-settings/pull/11.
This would be pretty handy to run as a github action instead of as a bot. An action is much easier to get integrated into an org than an app and can be easier to try it out.
@elstudio would you resolve your conflicts? Maybe it's something that can be merged in?