Update ICAL Files #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Download and Store ICS File | |
on: | |
workflow_dispatch: # Allows manual trigger | |
jobs: | |
download-and-save-ics: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install dependencies | |
run: npm install | |
working-directory: .github/scripts | |
- name: Run script to download ICS | |
env: | |
ICS_URL: ${{ secrets.ICS_URL }} # Set the environment variable using the secret | |
run: npm start | |
working-directory: .github/scripts | |
- name: Commit and push if there are changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add ./ical/ | |
git commit -m "Update ICS file" -a || echo "No changes to commit" | |
git push |