Skip to content

Commit

Permalink
ci: use tasklist for the broken links issue
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileRolley committed Jan 2, 2025
1 parent 6ddd60e commit f1b8154
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .github/actions/reopen-issue-with-comment/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ async function run() {
state: "open",
body:
"_Une fois par semaine, une GH Action vient mettre à jour cette issue avec la liste des liens cassés._\n\n" +
"## Liens invalides au " +
"```[tasklist]\n### Liens invalides au " +
new Intl.DateTimeFormat("fr-FR", {
timeZone: "Europe/Paris",
dateStyle: "long",
}).format(now) +
"\n\n" +
inputs.comment.replace(/<br \/>/g, `\n`),
"\n" +
inputs.comment.replace(/<br \/>/g, `\n`) +
"```",
});
} catch (error) {
core.setFailed(error.message);
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/check-links-validity.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Check links validity
on:
push:
branches:
- main
schedule:
# https://crontab.guru/#0_11_*_*_2
- cron: "0 11 * * 2"
Expand Down
11 changes: 5 additions & 6 deletions scripts/check-links-validity.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ function sleep(ms) {
if (detectedErrors.length > 0) {
// Formattage spécifique pour récupérer le résultat avec l'action Github
if (process.argv.slice(2).includes("--ci")) {
const message = `
| Aide | Status HTTP |
|:-----|:-----------:|
${detectedErrors
.map(({ status, title, link }) => `| [${title}](${link}) | ${status} |`)
.join("\n")}`;
const message = detectedErrors
.map(
({ status, title, link }) => `- [ ] \`${status}\` [${title}](${link})`
)
.join("\n");

const format = (msg) =>
msg
Expand Down

0 comments on commit f1b8154

Please sign in to comment.