-
-
Notifications
You must be signed in to change notification settings - Fork 621
132 lines (116 loc) · 4.47 KB
/
daily.yaml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: "Chore: Daily Tasks"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions:
issues: write
pull-requests: write
concurrency:
group: lock
jobs:
generate-readme:
runs-on: actions-runners
name: "Generate readme files"
container:
image: ghcr.io/truecharts/devcontainer:3.1.10@sha256:c239addf725eb5cedf79517f8089fdafdc32b5270d1893ee87ae6e511b9bcae3
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
with:
token: ${{ secrets.OR_PAT }}
fetch-depth: 1
- name: Setting repo parent dir as safe safe.directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install cwebp
shell: bash
run: |
sudo apt-get -y update
sudo apt-get -y install webp
- name: Transcode icons to webp
shell: bash
run: |
# Find all files named icon.* in all subfolders and transcode to webp
find . -type f -name 'icon.*' | while read -r FILE
do
DIR=$(dirname "$FILE") # get the directory of the current file
EXT=${FILE##*.} # file extension
QUALITY=75 # quality for the image
# Transcode to icon.webp
if [[ "$EXT" != "webp" && ! -f "${DIR}/icon.webp" ]]; then
echo "converting file to icon.webp: $FILE"
cwebp -resize 150 150 -m 6 -mt -q $QUALITY "$FILE" -o "${FILE/%.$EXT/.webp}" &>/dev/null || echo "transcode failed for icon.webp"
fi
# Transcode to icon-small.webp
if [[ "$EXT" != "webp" && ! -f "${DIR}/icon-small.webp" ]]; then
echo "converting file to icon-small.webp: $FILE"
cwebp -resize 32 32 -m 6 -mt -q $QUALITY "$FILE" -o "${DIR}/icon-small.webp" &>/dev/null || echo "transcode failed for icon-small.webp"
fi
# Remove the original file if it's not a .webp file after both transcodes
if [[ "$EXT" != "webp" ]]; then
rm "$FILE"
fi
done
- name: Fix Fixable Pre-Commit issues
shell: bash
run: |
echo "Running pre-commit test-and-cleanup..."
pre-commit run --all ||:
# Fix sh files to always be executable
find . -name '*.sh' | xargs chmod +x
# Clean up chart.yaml after pre-commit changes
# Avoids un-needed git diff changes, due to quoting and array ordering
- name: Fix Chart.yaml
shell: bash
run: |
./charttool genmeta
- name: Cleanup
run: |
rm -rf changes.json
rm -rf master
- name: Commit changes
run: |
git config user.name "TrueCharts-Bot"
git config user.email "[email protected]"
git pull
git add --all
git commit -sm "Commit daily changes" || exit 0
git push
lock-threads:
runs-on: actions-runners
steps:
- uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5
with:
github-token: ${{ secrets.BOT_TOKEN }}
issue-inactive-days: "7"
exclude-any-issue-labels: ""
issue-comment: "This issue is locked to prevent necro-posting on closed issues. Please create a new issue or contact staff on discord of the problem persists"
issue-lock-reason: ""
pr-inactive-days: "7"
pr-comment: "This PR is locked to prevent necro-posting on closed PRs. Please create a issue or contact staff on discord if you want to further discuss this"
pr-lock-reason: "resolved"
log-output: true
# check-contributors:
# name: Check Contributors
# runs-on: actions-runners
# steps:
# - name: Checkout
# uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
# with:
# token: ${{ secrets.BOT_TOKEN }}
# repository: truecharts/charts
# fetch-depth: 110
#
# - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
# with:
# node-version: 18
#
# - uses: borales/actions-yarn@3766bb1335b98fb13c60eaf358fe20811b730a88 # v5.0.0
# with:
# cmd: install --frozen-lockfile
#
# - name: List missing and unknown contributors
# env:
# PRIVATE_TOKEN: ${{ secrets.BOT_TOKEN }}
# run: |
# awk -F', ' '{ for( i=1; i<=NF; i++ ) print $i }' <<<$(yarn all-contributors check)