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

Write the first action version #1

Merged
merged 13 commits into from
Jul 1, 2020
Merged

Write the first action version #1

merged 13 commits into from
Jul 1, 2020

Conversation

namelivia
Copy link
Collaborator

@namelivia namelivia commented Jun 8, 2020

This is the first version of our first custom Github action.
The purpose of this action is to scan for certain labels on the PR, then check for a configuration file that will be present on the repo with pairs like migration, 4, typescript, 5 etc... and then if there is a match it will check if the PR has been approved by at least the highest matching number of reviewers.
Why is this based on labels? So this can be plugged-in with other open-source github actions we already have like the one that auto-labels the PR's based on the files that are being commited. By pluggin-in these two we can create things like "if a PR contains a migration file, tag the file as migration and do no let it be merged until approved by 2 people"

Ideally we could opensource this action too so other people can use it in their workflows. I'm syncing with @javiertejero tomorrow morning about this.

But first I'm creating this mainly for @giuband , there is some stuff I'll like to be reviewed, specially the javascript/typescript flavor, I just adopted some configurations from somewhere else and these are not our standards, so I would be completely ok if we decide to setup different customization.

@namelivia namelivia requested a review from giuband June 8, 2020 16:20
.gitignore Outdated Show resolved Hide resolved
src/entrypoint.ts Outdated Show resolved Hide resolved
tslint.json Outdated Show resolved Hide resolved
client
)
if (reviewCount < requiredReviews) {
toolkit.exit.failure(

Choose a reason for hiding this comment

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

I guess this raises an exception that is not catched and break execution flow, otherwise we need an else

}

Toolkit.run(async (toolkit: Toolkit) => {
toolkit.log.info('Running Action')

Choose a reason for hiding this comment

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

I would refactor out this run method to the lib so we can test it mocking the toolkit

.prettierrc Outdated Show resolved Hide resolved
@namelivia namelivia merged commit 1759545 into master Jul 1, 2020
@namelivia namelivia deleted the inital_development branch July 1, 2020 12:49
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.

None yet

3 participants