Release and Backport Status Check #225
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: Release and Backport Status Check | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 7 * * 1-5' # every weekday at 8am/9am Central European Time | |
jobs: | |
check-release-status: | |
# don't run this workflow on a cron for forks | |
if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }} | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: release | |
- name: Prepare build scripts | |
run: cd ${{ github.workspace }}/release && yarn --frozen-lockfile && yarn build | |
- name: Check release status and post to Slack | |
uses: actions/github-script@v7 | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }} | |
with: | |
script: | # js | |
const { checkReleaseStatus } = require('${{ github.workspace }}/release/dist/index.cjs'); | |
if (!process.env.SLACK_BOT_TOKEN) { | |
throw new Error('SLACK_BOT_TOKEN is required'); | |
} | |
if (!process.env.SLACK_RELEASE_CHANNEL) { | |
throw new Error('SLACK_RELEASE_CHANNEL is required'); | |
} | |
const ossReleased = await checkReleaseStatus({ | |
github, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
channelName: process.env.SLACK_RELEASE_CHANNEL, | |
}); | |
open-backport-reminder: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: release | |
- name: Prepare build scripts | |
run: cd ${{ github.workspace }}/release && yarn --frozen-lockfile && yarn build | |
- name: Check release status and post to Slack | |
uses: actions/github-script@v7 | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
with: | |
script: | # js | |
const { checkOpenBackports } = require('${{ github.workspace }}/release/dist/index.cjs'); | |
if (!process.env.SLACK_BOT_TOKEN) { | |
throw new Error('SLACK_BOT_TOKEN is required'); | |
} | |
const ossReleased = await checkOpenBackports({ | |
github, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
channelName: 'engineering-ci', | |
}); |