I recently tried to implement a Github action that should run daily and save a file to folder in the repository.
The jobs of this Github action run without errors but neither the folder nor the file show up in my repository.
You find the yml file here:
name: Save RKI-Excel file Impfmonitoring
on: [push]
#schedule:
# - cron: '0 0 * * *'
jobs:
save-excel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Directory
run: |
mkdir -p data
- name: Download Excel File
run: |
python -c "from urllib.request import urlretrieve; urlretrieve('https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile', 'data/data.xlsx')"
- name: Save Excel File
run: |
mv data/data.xlsx data/$(date +"%Y-%m-%d")-data.xlsx
The idea is that it downloads the xlsx file everyday and stores it with a timestamp in the filename in a directory called "data" situated in the repo "github_actions".
The action runs without errors but directory and files don’t show up there.
https://github.com/analphabit/github_actions/actions/runs/3700392300
What am I missing here?
Thank you
Bartleby
2
Answers
Be sure to
git add
,git commit
andgit push
:This is what I do in my workflows in a
pwsh
step:This just creates a file inside the virtual machine. You need to commit and push the new changes also. For example, by using the Git Auto Commit Action:
To read more about GH Actions runners, visit the Runners section.