githubnext / blocks-template

A template for creating custom Blocks.
MIT License
112 stars 11 forks source link

pass PAT from environment to `onRequestGitHubData` #24

Closed jaked closed 2 years ago

jaked commented 2 years ago

Pass a personal access token from the process environment to onRequestGitHubData, to make testing blocks that call the GitHub API easier. (I tested this with https://github.com/mattrothenberg/codeowners-block)

I also fixed a couple other uses of PATs: I don't think Accept: Bearer ${PAT} is valid, so I replaced it with Authorization: Bearer ${PAT}; but Authorization headers are rejected by raw.githubusercontent.com because of CORS so I dropped that one. If I've misunderstood things please let me know!