-
-
Notifications
You must be signed in to change notification settings - Fork 45
71 lines (63 loc) · 2.32 KB
/
lister.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: "Sync Apps Lists to Another Repo"
on:
push:
branches: main
paths:
- 'programs/**'
- 'programs/**'
- 'programs/**'
- '!programs/x86_64/**'
- '!programs/i686/**'
- '!programs/aarch64/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sync-files:
name: "Run sync"
runs-on: ubuntu-22.04
steps:
- name: "Checkout source repository"
uses: actions/checkout@v4
- name: "Run lister"
run: |
cd programs
chmod a+x appimage-lister-uniq.sh
./appimage-lister-uniq.sh
- name: "Clone Target Repository"
env:
TARGET_REPO_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }}
TARGET_OWNER: ivan-hc
TARGET_REPO: AM
run: |
git clone "https://x-access-token:[email protected]/$TARGET_OWNER/$TARGET_REPO.git" target-repo
- name: "Copy Files"
run: |
cp programs/x86_64-appimages programs/i686-appimages programs/aarch64-appimages target-repo/
- name: "Push to Source"
run: |
# You have to create PAT (Personal Access Token) with repo and workflow scopes enabled
# Save it as secret in repository where action will run (source) with name 'TARGET_REPO_TOKEN'
# Change your email, then should work as expected
git config --global user.name "ivan-hc"
git config --global user.email "[email protected]"
git add programs/x86_64-appimages programs/i686-appimages programs/aarch64-appimages
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
- name: "Push to Target"
run: |
cd target-repo
git config --global user.name "ivan-hc"
git config --global user.email "[email protected]"
git add .
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 Target Succeeded" >> $GITHUB_STEP_SUMMARY
fi