-
Notifications
You must be signed in to change notification settings - Fork 225
38 lines (38 loc) · 1.39 KB
/
link-check-schedule.yml
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
name: Check links on schedule
on:
schedule:
- cron: "59 23 * * 0" # Runs every Sunday at 23:59
push: # for testing purposes, do not merge
jobs:
linkcheck:
runs-on: ubuntu-latest
steps:
- uses: filiph/linkcheck@3.0.0
with:
arguments: https://www.scaleway.com/en/docs/serverless/ >> linkcheck_output.txt
- name: Parse output to variable
if: always()
run: |
FILE_CONTENT=$(cat linkcheck_output.txt)
echo "file_content=$FILE_CONTENT" >> $GITHUB_ENV
- name: check if content exists
run: |
echo "$GITHUB_ENV"
- name: Send message to Slack
id: initial_message
if: always() # Triggers step if previous step fails. Must be added to consecutive steps as well.
uses: slackapi/slack-github-action@v2.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "Link check results are available in :thread:."
- name: Reply with output of linkcheck
if: always()
uses: slackapi/slack-github-action@v2.0.0 # ref: https://github.com/slackapi/slack-github-action
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
thread_ts: "${{ steps.initial_message.outputs.ts }}"
text: "$FILE_CONTENT"