Skip to content

feat(gen): update

feat(gen): update #40

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/[email protected]
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
# if: always()
# uses: slackapi/[email protected]
# id: initial_message
# with:
# webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
# webhook-type: incoming-webhook
# payload: |
# channel: ${{ secrets.SLACK_CHANNEL_ID }}
# text: "Link check results are available in :thread:."
- name: Send a message to Slack via Webhook
id: send_message
run: |
response=$(curl -s -X POST -H 'Content-type: application/json' \
--data '{
"text": "Link check results are available in :thread:."
}' ${{ secrets.SLACK_WEBHOOK_URL }})
echo "response=$response" >> $GITHUB_ENV
- name: Save thread_ts
run: |
echo "thread_ts=<MANUALLY_SET_OR_CAPTURE_THIS_VALUE>" >> $GITHUB_ENV
- name: Reply to the thread via Webhook
run: |
curl -s -X POST -H 'Content-type: application/json' \
--data '{
"text": "This is a reply to the thread.",
"thread_ts": "${{ env.thread_ts }}"
}' ${{ secrets.SLACK_WEBHOOK_URL }}