Skip to content

nofusscomputing/git-events

Repository files navigation

No Fuss Computings Git[ea/hub] Event Processing

Documentation for the collection.

TL;DR

Name required Description
GIT_API_TOKEN API token to access Git[ea/hub] to post PR Review.
GIT_API_URL API URL to access Git[ea/hub]. To create random one `echo $(head -c 50 /dev/urandom
GIT_INTERNAL_API_URL An internal URL to use in place of the public API URL. i.e. DMZ url.
GIT_EVENT_RULEBOOK_TOKEN The token to set for the inbound connection to the container.
GIT_EVENT_RULEBOOK_PORT The port to listen for inbound webhooks. Defaults to 5000
ENABLE_DEBUG_LOGGING Turn on playbook debug logging. Defaults to false ⚠️ Doing this will output you auth tokens to the log.

Steps

  1. deploy somewhere that git[ea/hub] has access to the container
  2. ensure vars above are set within the container
  3. Gor Gitea Go to Site ADministration -> Integrations-> Webhooks
    1. Add a system webhook
    2. set the http url to the container ip/dns name. ensure port is specifed. suffic :<port number>
    3. select Trigger On -> Workflow Jobs
    4. set Authorization Header to Bearer <actual value of GIT_EVENT_RULEBOOK_TOKEN>
    5. click Update Webhook to save
  4. you are now GTG and all jobs will get posted to the container for processing.

Setup Parsing of matchers

  1. Before any parsing can be done the following must be output with the id of the pull request to enable the problem matcher parsing.

    echo "NFC_PROBLEM_MATCHER=${GITHUB_REF_NAME}";
    
  2. Ansible Lint

    1. before pylint runs, ensure the following commands are executed in your workflow.
    echo "NFC_PROBLEM_MATCHER_TYPE=pylint-json";
    
    1. the output format for pylint is json. i.e. ansible-lint -f json .
  3. Parsing normal GitHub Problem matchers

    1. Before the job runs, give the matcher a name, no spaces, only letters and can have - and _
    echo "NFC_PROBLEM_MATCHER_TYPE=My-Job-Name";
    
    1. now run the job that outputs in standrd Github style problem matchers.
  4. Now the user will have a PR reviews done with the contents of the problem matcher(s) as review comments.

Releases

No releases published

Packages