GithubHelp home page GithubHelp logo

definitelyadev / gitea-comment Goto Github PK

View Code? Open in Web Editor NEW
35.0 2.0 2.0 23 KB

A Drone plugin to post comments on a Gitea Pull Request

License: GNU General Public License v3.0

Dockerfile 3.79% C# 96.21%
gitea gitea-drone drone-ci docker

gitea-comment's Introduction

Gitea Comment

A Drone plugin to post comments on a Gitea Pull Request

Docker Hub: https://hub.docker.com/r/tsakidev/giteacomment

Example reference for pull request with static string:

steps:
- name: post-to-gitea-pr
  image: tsakidev/giteacomment:latest
  settings:
    gitea_token:
      from_secret: gitea_token
    gitea_base_url: http://gitea.example.com
    comment: "Hello from Drone"
  when:
    status: [ failure ]
    event: pull_request

Example reference for pull request with input from file:

steps:
- name: post-to-gitea-pr
  image: tsakidev/giteacomment:latest
  settings:
    gitea_token:
      from_secret: gitea_token
    gitea_base_url: http://gitea.example.com
    comment_title: "My Title"
    comment_from_file: "/path/to/file.txt"
  when:
    status: [ failure ]
    event: pull_request

gitea-comment's People

Contributors

definitelyadev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

umsch m42e

gitea-comment's Issues

Data from file is not escaped for json

As the title says, data from the file are not formatted for json. Any double quotes or backslashes will break the json formatting. I have to do this with sed manually for each logfile.

sed 's/\\\\/\\\\\\\\/g' file.log | sed 's/"/\\\\"/g' > file-out.log

The formatting of sed backslashes is weird because of drone.yml also escapes backslashes.

Complete working escaping step:

- name: Escape json
  image: alpine
  commands:
    - sed 's/\\\\/\\\\\\\\/g' output.log | sed 's/"/\\\\"/g' > output-out.log

I would suggest to use a kind of json escaping library, I do not know if my solution of replacing just \ with \\ and " with \" has any edge cases.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.