Code Monkey home page Code Monkey logo

Comments (3)

j2kun avatar j2kun commented on August 17, 2024

Looks like I can maybe get it from the GITHUB_EVENT_PATH env var shown by Jess here

https://blog.jessfraz.com/post/the-life-of-a-github-action/

And seems to be documented in the webhooks here: https://developer.github.com/webhooks/#events

Need to figure out what in the payload content can tell me what files were changed in the PR

from chktex-action.

j2kun avatar j2kun commented on August 17, 2024

Looks like https://developer.github.com/v3/pulls/#list-pull-requests-files

And I can

GET /repos/:owner/:repo/pulls/:pull_number/files

Look for the status field and ensure it's not removed (what is the exact string there?), and then deal with pagination. Maybe time to drop to a python API client...

[
{
"sha": "bbcd538c8e72b8c175046e27cc8f907076331401",
"filename": "file1.txt",
"status": "added",
"additions": 103,
"deletions": 21,
"changes": 124,
"blob_url": "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt",
"raw_url": "https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt",
"contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e",
"patch": "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test"
}
]

from chktex-action.

j2kun avatar j2kun commented on August 17, 2024

Got the python api and can get the pull request files info using

https://pygithub.readthedocs.io/en/latest/examples/PullRequest.html#get-pull-request-by-number

from chktex-action.

Related Issues (3)

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.