Skip to content

Create fetchIssues.js #32

Create fetchIssues.js

Create fetchIssues.js #32

Workflow file for this run

name: Return Data from JavaScript Function
on:
push:
branches:
- main
jobs:
call_api_job:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Node.js and NPM
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install Dependencies
run: |
npm install axios
working-directory: ${{ github.workspace }}
- name: Run JavaScript File
id: fetchIssues
run: |
data=$(node -e "const myFunction = require('./fetchIssues'); async function main() { try { const data = await fetchIssues(); console.log(JSON.stringify(data));} catch (error) { console.error('Error retrieving data:', error);}}; main()")
echo "$data" > issues.json
- name: Push into Git
run: |-
git config --global user.email "[email protected]"
git config --global user.name "ARK Builders Bot"
git add issues.json
git commit -m "Automated update of rate"
git push