forked from ivan-hc/VirtualBox-appimage
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1.04 KB
/
cronjob.yml
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
name: Github Action with a cronjob trigger
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
sync-files:
name: "Run sync"
runs-on: ubuntu-latest
steps:
- name: "Checkout source repository"
uses: actions/checkout@v4
- name: "List releases"
run: |
curl -Ls https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest | sed 's/[()",{} ]/\n/g' | grep -oi "https.*mage$" > latest-release.txt
- name: "Push to Source"
run: |
git config --global user.name "ivan-hc"
git config --global user.email "[email protected]"
git add latest-release.txt
if git diff-index --quiet HEAD; then
echo "No changes to commit." >> $GITHUB_STEP_SUMMARY
else
git commit -m "Sync files from source repository"
git push && echo "Sync to Source succeeded" >> $GITHUB_STEP_SUMMARY
fi