example-github-v2.yaml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: github-user-lookup
  2. description: Fetch GitHub user profile and repos; emit SocialAccount + Posts
  3. category: Username
  4. version: 1.1
  5. input:
  6. type: Username
  7. key: value
  8. secrets:
  9. - name: GITHUB_TOKEN
  10. required: true
  11. request:
  12. - id: user
  13. method: GET
  14. url: https://api.github.com/users/{{value}}
  15. headers:
  16. Accept: application/vnd.github+json
  17. Authorization: Bearer {{secrets.GITHUB_TOKEN}}
  18. X-GitHub-Api-Version: "2022-11-28"
  19. User-Agent: flowsint-enricher
  20. timeout: 15
  21. - id: repos
  22. method: GET
  23. url: https://api.github.com/users/{{value}}/repos?per_page=100&sort=updated
  24. headers:
  25. Accept: application/vnd.github+json
  26. Authorization: Bearer {{secrets.GITHUB_TOKEN}}
  27. X-GitHub-Api-Version: "2022-11-28"
  28. User-Agent: flowsint-enricher
  29. timeout: 15
  30. response:
  31. expect: json
  32. outputs:
  33. - type: SocialAccount
  34. from: user
  35. map:
  36. username: login
  37. display_name: name
  38. profile_url: html_url
  39. profile_picture_url: avatar_url
  40. bio: bio
  41. location: location
  42. created_at: created_at
  43. followers_count: followers
  44. following_count: following
  45. posts_count: public_repos
  46. - type: Post
  47. from: repos
  48. for_each: "$" # iterate over the root array
  49. map:
  50. id: id
  51. title: name
  52. url: html_url
  53. created_at: created_at
  54. updated_at: updated_at
  55. description: description
  56. language: language
  57. stars: stargazers_count
  58. owner_username: owner.login
  59. owner_profile_url: owner.html_url
  60. retry:
  61. max_retries: 3
  62. backoff_factor: 1.0
  63. retry_on_status: [429, 500, 502, 503, 504]