Hi @Lakshana,
Firstly, created a custom Connector with webhook:
Later, to get the file content, I have used Parse Json
action to parse the trigger body.
Then, used Compose
to get modified file name. In my example, I have done it for modified files, you can also do for new files which are created by adding a parallel action.
I am getting the output as ["filename"]
in Parse Json action , so modified it to filename
using below function in Compose Action:
for modified:
replace(replace(replace(string(items('For_each')?['modified']), '[', ''), ']', ''), '"', '')
for created :
replace(replace(replace(string(items('For_each')?['created']), '[', ''), ']', ''), '"', '')
Then, used the http action:
GET https://api.github.com/repos/{owner}/{repositoryname}/contents/{path/filenname.ext}
You can also get Owner name, Repository Name and all from Parse JSON
action only, but I have given it manually.
My repository is public, so did not gave any authorization, if yours is private then need to give PAT token in authorization header while calling the file content.
Output:
This is how I get the content of GITHUB files using Logic apps.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.