Skip to content

Commit

Permalink
WIP: 2023-08-24 11:11:58
Browse files Browse the repository at this point in the history
  • Loading branch information
baptou12 committed Aug 24, 2023
1 parent 28febda commit c4e7ef3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/check-links-validity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ jobs:
- uses: actions/checkout@v3
- run: npm ci
- id: invalid_links
run: |
output=$(npm run tools:check-links-validity | tail -n 1)
echo $output
echo "GRIST_UPDATED=$output" >> $GITHUB_ENV
run: npm run tools:check-links-validity
timeout-minutes: 60
env:
GRIST_DOC_ID: ${{ secrets.GRIST_DOC_ID }}
GRIST_API_KEY: ${{ secrets.GRIST_API_KEY }}
- run: echo ${{ steps.invalid_links.outputs.GRIST_UPDATED }}
- name: Send dead links info message
shell: bash
run: |
curl -i -X POST -H 'Content-Type: application/json' -d '{"text": ":icon-info: La liste des aides avec des liens invalides a été mise à jour ici : [lien](https://github.com/betagouv/aides-jeunes/issues/2945)"}' ${{ secrets.MATTERMOST_POST_URL }}
7 changes: 4 additions & 3 deletions tools/check-links-validity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import config from "../backend/config/index.js"
import { determineOperationsOnBenefitLinkError } from "../lib/benefits/link-validity.js"
import { GristData } from "../lib/types/link-validity.js"
import { Grist } from "../lib/grist.js"
import Mattermost from "../backend/lib/mattermost-bot/mattermost.js"

import axios from "axios"
import https from "https"
Expand Down Expand Up @@ -269,9 +270,9 @@ async function main() {
recordsByOperationTypes.update.length > 0

if (gristUpdated && !dryRun && !processingPR) {
console.log("true")
} else {
console.log("false")
Mattermost.post(
":icon-info: La liste des aides avec des liens invalides a été mise à jour ici : [lien](https://grist.incubateur.net/o/docs/mRipN1JbV6sB/Aides-Jeunes/p/39)"
)
}
}

Expand Down

0 comments on commit c4e7ef3

Please sign in to comment.