-
Notifications
You must be signed in to change notification settings - Fork 240
52 lines (50 loc) · 1.68 KB
/
preflight_cleanup.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Preflight Tests Cleanup
on:
schedule:
- cron: "*/30 * * * *"
workflow_dispatch:
inputs:
reason:
description: Brief reason for running this workflow manually
required: false
default: User initiated run
type: string
jobs:
preflight-tests:
if: ${{ github.repository == 'superfly/flyctl' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
check-latest: true
- name: Get go version
id: go-version
run: echo "name=version::$(go env GOVERSION)" >> $GITHUB_OUTPUT
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Run cleanup script
env:
FLY_PREFLIGHT_TEST_ACCESS_TOKEN: ${{ secrets.FLYCTL_PREFLIGHT_CI_FLY_API_TOKEN }}
FLY_PREFLIGHT_TEST_FLY_ORG: flyctl-ci-preflight
run: |
go run ./scripts/clean-up-preflight-apps
- name: Post failure to slack
if: ${{ github.ref == 'refs/heads/master' && failure() }}
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0
env:
SLACK_WEBHOOK_URL: ${{ secrets.PREFLIGHT_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":warning: preflight test cleanup failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}