Please, I have written a simple web scraping application, which I want to automate with github actions. I believe I have set everything up correctly, including my YML file, but after committing, my workflow run is still "0". Please find below my YML file:
name: Aljazeera_headlines_scraper
# Controls when the action will run.
on:
schedule:
- cron: '*/10 * * * 1-5'
jobs:
autoscrape:
# The type of runner that the job will run on
runs-on: windows-latest
# Load repo and install R
steps:
- uses: actions/checkout@master
- uses: r-lib/actions/setup-r@master
# Set-up R
- name: Install packages
run: |
R -e 'install.packages("rvest")'
R -e 'install.packages("tidyverse")'
# Run R script
- name: Scrape
run: Rscript Aljazeera_scraper.R
# Add new files in data folder, commit along with other modified files, push
- name: Commit files
run: |
git config --local user.name actions-user
git config --local user.email "actions@github.com"
git add data/*
git commit -am "GH ACTION Headlines $(date)"
git push origin main
env:
REPO_KEY: ${{secrets.GITHUB_TOKEN}}
username: github-actions
I want it to scrape headline links from the news website every 10 minutes of every day, and store that in a csv file in the data folder. Nevertheless, I do not see any indication that my workflow is running; and when I check the log, I see 0 activity. Please, is there something I am not getting right? This is my first attempt at automating my R script. Thanks for your support as always.
Run git config --local user.name actions-user
[15](https://github.com/Ifeanyi55/AutoScraper/runs/4396298100?check_suite_focus=true#step:5:15)On branch main
[16](https://github.com/Ifeanyi55/AutoScraper/runs/4396298100?check_suite_focus=true#step:5:16)Your branch is up to date with 'origin/main'.
[17](https://github.com/Ifeanyi55/AutoScraper/runs/4396298100?check_suite_focus=true#step:5:17)
[18](https://github.com/Ifeanyi55/AutoScraper/runs/4396298100?check_suite_focus=true#step:5:18)nothing to commit, working tree clean
[19](https://github.com/Ifeanyi55/AutoScraper/runs/4396298100?check_suite_focus=true#step:5:19)Error: Process completed with exit code 1.
But the package install step completes. The entire process fails at the commit step, and I can't fathom why. Please, do you have any more helpful suggestions? I am really desperate now.
Thanks so much for patiently helping me; I do appreciate it. I am thinking of starting all over again with a new repo. Please, can you just give me the steps to follow, so that I can correctly set up my github-actions to run my script on schedule, if it isn't too much trouble for you? I will greatly appreciate that. I will also want to use it as a reference for future projects. Thanks a lot.