I would like to set up a GitHub actions workflow that:
- Makes an API request to another site (outside of GitHub), which returns JSON.
- Add (commit) that JSON to my repo
I have an action that looks like below. It appears to run correctly, and the log even outputs that the file has been saved. But, the file never appears anywhere in my repo.
I've never set up actions before, so I'm new to some of the terminology around them as well.
Any tips or thoughts on how to get this action or work, or an alternative approach?
name: Refresh Feed
on: [push]
jobs:
refresh-feed:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Fetch API Data
uses: JamesIves/[email protected]
with:
ENDPOINT: https://www.loc.gov/maps/?fa=location:cyprus&fo=json&at=results
RETRY: true
I mean from the readme of the repo it seems that you just need to run this action with the github token. I just ran the Fetch API Data action and was able to see the new directory created by running an ls on an step after the action.
How to get github token
Then you would need to create a secret and add the env ACCESS_TOKEN
How to create secrets in repo
Action to run