Skip to content

Using twarc as part of a GitHub Workflow #663

Answered by igorbrigadir
DanielBrett asked this question in Q&A
Discussion options

You must be logged in to vote

The best way to do it, would be to create a new secret variable on the git repo settings: https://github.com/you/your-repo/settings/secrets/actions called BEARER_TOKEN with your bearer token,

And then in the action, run:

twarc2 --bearer-token "${{ secrets.BEARER_TOKEN }}" search "dog" >> results.jsonl

Or some other combination of --consumer-key --consumer-secret or whatever - see twarc2 --help for the authentication options.

Note the >> output - this will append to an existing file, if you leave it out, it will keep overwriting it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DanielBrett
Comment options

Answer selected by DanielBrett
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants