Issuer - GitHub action to force self-service of repository users

The project issuer a bot for GitHub has been prepared, which solves the tasks of forced self-service of repository users. On GitHub, you can find repositories whose only function is to coordinate people through the Issue system. In some of them, those leaving the Issue are asked to fill out a form. Then the moderator comes, checks the correctness of filling out the form, and hangs the tags in accordance with those indicated in the form (tags can only be hung by a privileged user if they are not specified in the template). An example of such a community is open-source-ideas/open-source-ideas.

The moderator does not come immediately. Therefore, to validate forms and perform operations prepared the GitHub action presented in the news. The bot is written in Python, but you still have to run it through node.js, since GitHub has only 2 types of actions - node.js and docker, and for docker, the same container is loaded first, where node.js is, and loaded into it another container, which is long. Considering that in the container with node.js python3 and everything else you need is already there, it’s rational to just load the dependencies into it, since they are small.

Features:

  • The action is controlled using a YAML config and Markdown templates;
  • A block is added to each Markdown template that describes the conditions for correctly filling out the form and the desired actions;
  • A configuration file with global settings is added;
  • Forms are made up of sections. There are 2 types of sections:
    • Free text. The action can check that the user has bothered to fill in something. The meaning of the text is not automatically checked.
    • Checkboxes. You can require n checkboxes to be filled, such that 0 {= m1 {= n {= m2 {= total number of checkboxes in the section. The action checks that the checkboxes match the checkboxes in the template. If the flags are set correctly, the action can hang tags on the issue, resp. checkboxes.
  • If the form is filled out incorrectly, then the action instructs the user how to fill it out correctly and hangs a special label.
  • If the form is not fixed within a certain time, then the action can close the issue. Automatic banning of users, deleting and moving an issue has not yet been implemented due to the lack of an official API for the necessary actions and problems with state storage.
  • If the problem is resolved, the action removes the label.
  • Action response templates are, of course, configurable.

Source: opennet.ru

Add a comment