Skip to content

Commit 188aa82

Browse files
authored
Merge pull request #62 from ivan-hc/main
Remove "orphaned" icons in a separate process
2 parents 63c0b81 + ededc9d commit 188aa82

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Remove icons"
2+
3+
# Icons are retained with the hope that deleted apps will be reintroduced in the future.
4+
# This workflow is included in the main one but disabled. Use this if orphaned icons are too many.
5+
6+
on:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
sync-files:
18+
name: "Run sync"
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: "Checkout source repository"
22+
uses: actions/checkout@v4
23+
24+
- name: "Remove unneeded icons"
25+
run: |
26+
AMD64_LIST=$(curl -Ls https://raw.githubusercontent.com/ivan-hc/AM/main/programs/x86_64-apps)
27+
if [ -n "$AMD64_LIST" ] && echo "$AMD64_LIST" 2>/dev/null | grep -q "^◆ "; then
28+
29+
PNGS=$(ls icons/* | sed 's:.*/::; s/.png$//g')
30+
for p in $PNGS; do
31+
if ! echo "$AMD64_LIST" 2>/dev/null | grep -q "◆ $p :"; then
32+
rm -f "icons/$p.png"
33+
echo "Removed icons/$p.png"
34+
fi
35+
done
36+
37+
fi
38+
39+
- name: "Push to Source"
40+
run: |
41+
git config --global user.name "Portable-Linux-Apps"
42+
git config --global user.email "[email protected]"
43+
git add icons
44+
if git diff-index --quiet HEAD; then
45+
echo "No changes to commit." >> $GITHUB_STEP_SUMMARY
46+
else
47+
git commit -m "Remove extra icon/icons"
48+
git push && echo "Sync to Source succeeded" >> $GITHUB_STEP_SUMMARY
49+
fi

0 commit comments

Comments
 (0)