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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitHub Actions to automatically label Pull Requests #2420

Merged
merged 2 commits into from Jan 21, 2020
Merged

Use GitHub Actions to automatically label Pull Requests #2420

merged 2 commits into from Jan 21, 2020

Conversation

ericcornelissen
Copy link
Contributor

@ericcornelissen ericcornelissen commented Jan 20, 2020

Issue: None

Checklist

n/a

Description

We got access to GitHub Actions a while back when it was still beta-access only but unfortunately haven't used it yet (we initially wanted to use it for #982) and I want to start using it to implement some stuff, among others #2380 and simple-icons/simple-icons-font#1. However, I decided to start with something that is a bit simpler, namely:

Feature: Adding the labels new icon and updated icon to Pull Requests automatically based on the files added or changed in the Pull Request.1

For those unfamiliar with GitHub Actions the file .github/workflows/pull_requests.yml defines a "workflow", which is analogous to a build defined in .travis.yml. In it I say that on: [pull_requests] I want to do some stuff, run one or more "actions", namely I want to run(s-)on: ubuntu-latest a step as defined by ericcornelissen/labeler@master. In the case of the "action" is configured by .github/labeler.yml (which is a hard requirement from the "action" itself). The (currently incomplete) documentation for the configuration can be found in the project's README.

I tested the workflow in my fork of this repository, you can see the final results in this Pull Request and this Pull Request (and a bunch more attempts in the list of closed Pull Requests). Also, the action should run on this Pull Request, but it does nothing as the files changed don't match the globs in the configuration. Based on this article it looks like the actions won't start running until this is merged because this PR is coming from a fork (rather than this repo) so I hope it will start working 馃

Why do this with GitHub Action rather than Travis CI? To try it out and learn, but also because I think it is easier to use and work with especially when you want to do stuff like in #2380. We don't need to move our Travis CI builds to GitHub Actions, but we could do that as well. Also, I like it very much that all the configuration is in the .github/ directory 馃檭

PS. I'm using my personal fork of actions/labeler (namely ericcornelissen/labeler) because I could not any labeling action that checked whether a file was added or changed (or removed for that matter). I do have an open issue regarding this feature to see if there is more interest, if so it may get merged and then we can update this action accordingly.


1: I would personally have preferred if multiple PR templates was a thing, just like multiple Issue templates are...

I'm using my personal fork of https://github.com/actions/labeler because 
I could not any labeling action that checked whether a file was added or 
changed (or removed).
@ericcornelissen ericcornelissen added the meta Issues or pull requests regarding the project or repository itself label Jan 20, 2020
@runxel
Copy link
Member

runxel commented Jan 20, 2020

That's cool! Had that on my bucket list as well :)

Copy link
Member

@runxel runxel left a comment

Choose a reason for hiding this comment

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

Since nobody complains we can merge this nice thing in 馃槑
Thanks @ericcornelissen!

@runxel runxel merged commit f357ac7 into simple-icons:develop Jan 21, 2020
@ericcornelissen ericcornelissen deleted the ci/auto-label-prs branch January 22, 2020 07:16
@runxel
Copy link
Member

runxel commented Jan 22, 2020

Uuuh, .... somethings wrong, @ericcornelissen 馃槰
Please have a look

fail

@ericcornelissen
Copy link
Contributor Author

ericcornelissen commented Jan 22, 2020

I had noticed this already, seems to be the problem discussed in actions/labeler#12 馃槥 I'm trying to find a solution, if I can't find anything I will Revert this Pull Request...

Anyway, for now you can merge a Pull Request where this error occurs if you want. It's not pretty but it's fine 馃憤

@runxel
Copy link
Member

runxel commented Jan 22, 2020

Ach, what a shame.
Then let's hope the mprovement of yours gets some attention and will be included upstream.

@ericcornelissen
Copy link
Contributor Author

I will be reverting this PR as I can't find a solution at the moment nor think of a suitable solution. I might try to convert my solution into a Probot or we can use this bot if it can suite our needs.

Then let's hope the improvement of yours gets some attention and will be included upstream.

That would be nice nonetheless 馃檪 though I suspect our use case is quite niche

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned Pull requests that have been abandoned by the contributor meta Issues or pull requests regarding the project or repository itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants