This action retrieves a remote file with wget and compares it to the version in the repository. If a newer version is available remotely, it updates the file in the repository.
Required The url of the remote file to download.
Required The location of the file in the repository to update if changed.
The name to commit under. Default: 'thelastproject/keep-remote-locally-up-to-date'.
The email to commit under. Default: 'no-reply@github.com'.
Put the following in .github/workflows/main.yml
:
jobs:
keep_file_updated:
runs-on: ubuntu-latest
name: Keep file updated
steps:
- name: Checkout repo
id: checkout
uses: actions/checkout@v4
- name: Update file
id: update_file
uses: TheLastProject/keep-remote-file-locally-up-to-date-action@v1
with:
url: https://example.com/index.html
file_in_repo: example/index.html
on:
schedule:
- cron: '0 0 * * *'
Creative Commons Zero 1.0 Universal