sync source code from terminal-wiki #3
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: Sync with terminal-wiki | |
on: | |
schedule: | |
# Runs the workflow every hour, you can adjust the cron value as needed | |
- cron: '0 * * * *' | |
workflow_dispatch: | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout wiki repository | |
uses: actions/checkout@v2 | |
with: | |
repository: yourusername/wiki | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Fetch changes from terminal-wiki | |
run: | | |
git remote add upstream https://github.com/charanravi-online/terminal-wiki.git || true # Ignore errors if the remote already exists | |
git fetch upstream | |
git merge upstream/main --allow-unrelated-histories -m "Merging changes from terminal-wiki" | |
git push origin main |