Skip to content

Commit 59800c0

Browse files
authored
Update check-latest-release.yml
1 parent c6c71db commit 59800c0

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

.github/workflows/check-latest-release.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
# Step 1: Checkout the repository
1514
- name: Checkout repository
1615
uses: actions/checkout@v3
1716

18-
# Step 2: Set up Node.js environment
1917
- name: Setup Node.js
2018
uses: actions/setup-node@v3
2119
with:
2220
node-version: 18
2321

24-
# Step 3: Install dependencies
2522
- name: Install dependencies
2623
run: npm install @octokit/rest
2724

28-
# Step 4: Check README for outdated release URLs
2925
- name: Check README for outdated release URLs
3026
run: |
3127
node --input-type=module <<'EOF'
@@ -61,19 +57,16 @@ jobs:
6157
const latestReleaseUrl = latestRelease.html_url;
6258
6359
console.log(` ➤ Latest Release URL: ${latestReleaseUrl}`);
64-
console.log(
65-
currentReleaseUrl === latestReleaseUrl
66-
? `✅ ${pluginName} is up-to-date.`
67-
: `❌ ${pluginName} is outdated. Please update the URL to ${latestReleaseUrl}.`
68-
);
69-
70-
if (currentReleaseUrl !== latestReleaseUrl) {
60+
if (currentReleaseUrl === latestReleaseUrl) {
61+
console.log(`✅ ${pluginName} is up-to-date.`);
62+
} else {
63+
console.log(`❌ ${pluginName} is outdated. Update the URL to ${latestReleaseUrl}`);
64+
console.log(`::warning file=README.md::${pluginName} is outdated. Update the URL to ${latestReleaseUrl}`);
7165
allCorrect = false;
7266
}
7367
} catch (error) {
74-
console.error(
75-
`⚠️ Failed to fetch the latest release for ${pluginName}. Error: ${error.message}`
76-
);
68+
console.error(`⚠️ Failed to fetch latest release for ${pluginName}. Error: ${error.message}`);
69+
console.log(`::error file=README.md::Failed to fetch latest release for ${pluginName}: ${error.message}`);
7770
allCorrect = false;
7871
}
7972
}

0 commit comments

Comments
 (0)