Preflight Tests Cleanup #5937
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: 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@v4 | |
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@e28cf165c92ffef168d23c5c9000cffc8a25e117 | |
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 }}" | |
} | |
} | |
] | |
} |