feat(gen): update #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | ||
{ | ||
echo 'LINKCHECK_OUTPUT<<EOF' | ||
cat linkcheck_output.txt | ||
echo EOF | ||
} >> "$GITHUB_ENV" | ||
- name: Send message to Slack | ||
id: initial_message | ||
if: always() | ||
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: Extract ts value | ||
run: echo "ts=${{ steps.initial_message.outputs.ts }}" >> $GITHUB_ENV | ||
- name: check if timestamp exists | ||
echo "${{ env.ts }}" | ||
- 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: "${{ env.ts }}" | ||
text: "$LINKCHECK_OUTPUT" |