Skip to content

Commit 59dcc4a

Browse files
authored
Update check-badges.yml
1 parent 8caa311 commit 59dcc4a

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

.github/workflows/check-badges.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@ jobs:
2929
run: |
3030
BADGES_FILE="../badges.json"
3131
OUTDATED_PLUGINS_FILE="/tmp/outdated_plugins_flag"
32-
REPORT="### 📢 Outdated Plugin Report\n\n@GarlicRot, the following plugins have outdated release URLs:\n\n"
33-
34-
echo "🔍 Checking latest releases for themes and plugins..."
32+
REPORT_FILE="outdated_plugins_report.md"
3533
3634
# Initialize the flag file
3735
echo "0" > $OUTDATED_PLUGINS_FILE
3836
37+
# Initialize the report file
38+
echo "### 📢 Outdated Plugin Report" > $REPORT_FILE
39+
echo "@GarlicRot, the following plugins have outdated release URLs:" >> $REPORT_FILE
40+
echo "" >> $REPORT_FILE
41+
42+
echo "🔍 Checking latest releases for themes and plugins..."
43+
3944
for SECTION in "themes" "plugins"; do
4045
cat $BADGES_FILE | jq -c --arg section "$SECTION" '.[$section][]' | while read entry; do
4146
NAME=$(echo $entry | jq -r '.name')
@@ -85,20 +90,22 @@ jobs:
8590
# Compare stored latest release URL with actual one
8691
if [[ "$LATEST_STORED" != "$LATEST_RELEASE" ]]; then
8792
echo "::error file=badges.json,title=Outdated Plugin::$OWNER/$REPO is outdated."
88-
# Append plugin details to REPORT
89-
echo "Appending details for: $NAME"
90-
REPORT+="🔹 **Plugin Name**: $NAME\n"
91-
REPORT+="🔹 **Stored URL**: [$LATEST_STORED]($LATEST_STORED)\n"
92-
REPORT+="🔹 **Latest URL**: [$LATEST_RELEASE]($LATEST_RELEASE)\n\n"
93-
echo "-----------------------------------"
93+
94+
# Append plugin details to the report file
95+
echo "🔹 **Plugin Name**: $NAME" >> $REPORT_FILE
96+
echo "🔹 **Stored URL**: [$LATEST_STORED]($LATEST_STORED)" >> $REPORT_FILE
97+
echo "🔹 **Latest URL**: [$LATEST_RELEASE]($LATEST_RELEASE)" >> $REPORT_FILE
98+
echo "" >> $REPORT_FILE
99+
100+
# Set the outdated flag
94101
echo "1" > $OUTDATED_PLUGINS_FILE
95102
fi
96103
done
97104
done
98105
99-
echo "$REPORT" > outdated_plugins_report.md
106+
# Debug: Print the report to console
100107
echo "Generated Report:"
101-
cat outdated_plugins_report.md
108+
cat $REPORT_FILE
102109
103110
# Export the outdated flag
104111
if [[ $(cat $OUTDATED_PLUGINS_FILE) == "1" ]]; then

0 commit comments

Comments
 (0)