-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (30 loc) · 1.34 KB
/
fetch_csv.yml
File metadata and controls
38 lines (30 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Fetch CSV from Private Repo
on:
workflow_dispatch: # Enable manual trigger
schedule:
# Run the job on the 13th of every month at 00:10 UTC
- cron: '10 0 13 * *'
jobs:
fetch_csv:
runs-on: ubuntu-latest
steps:
- name: Checkout the public repository
uses: actions/checkout@v3
- name: Checkout the private repository
uses: actions/checkout@v3
with:
repository: CommunityScale/Automation # Private repo
token: ${{ secrets.REPO_PAT }} # Use a PAT stored in repository secrets
path: private-repo
- name: Copy the CSV file and overwrite the existing file
run: cp -f private-repo/c_income_zhvi_mortgage_comprehensive_affordability.csv .
- name: Stage the modified file for commit
run: git add c_income_zhvi_mortgage_comprehensive_affordability.csv
- name: Display the status to ensure file is staged
run: git status # This will show whether the file is being tracked and changes are detected.
- name: Commit the CSV file
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "Overwrite CSV from private repo" || echo "No changes to commit"
git push || echo "Nothing to push"