Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support authorization header for http endpoints #33

Merged
merged 9 commits into from
May 28, 2021

Conversation

irealva
Copy link
Contributor

@irealva irealva commented May 28, 2021

Context
As users have brought up in #19, Flat did not support http endpoints that require authentication.

The original PR was submitted by @4lch4 in #22. I made tweaks to supply the authorization header only when it is not undefined and removed the version bump which is now outdated.

Fix
This PR adds an authorization param to the Flat action that requires a string and can be used to supply authentication information in the following way:

with:
    http_url: https://api.twitter.com/1.1/trends/place.json?id=1
    authorization: "Bearer ${{secrets.TWITTER_API_BEARER_TOKEN}}"
    downloaded_filename: twitter/trending-global-hashtags.json
    postprocess: ./src/processors/Twitter.ts

@irealva irealva linked an issue May 28, 2021 that may be closed by this pull request
Copy link
Contributor

@idan idan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change needed in action.yml but otherwise LGTM!

@irealva irealva merged commit e59f125 into main May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performing HTTP Requests w/ Authorization
3 participants