diff options
Diffstat (limited to '.github/workflows/beta-cut.yml')
| -rw-r--r-- | .github/workflows/beta-cut.yml | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/.github/workflows/beta-cut.yml b/.github/workflows/beta-cut.yml new file mode 100644 index 00000000..657c0ea8 --- /dev/null +++ b/.github/workflows/beta-cut.yml @@ -0,0 +1,69 @@ +name: Scheduled Beta Cut + +on: + schedule: + - cron: "0 20 * * 2" + workflow_dispatch: + +permissions: {} + +jobs: + gate: + runs-on: ubuntu-latest + timeout-minutes: 5 + outputs: + enabled: ${{ steps.gate.outputs.enabled }} + steps: + - name: Require BETA_AUTOMATION=enabled + id: gate + env: + BETA_AUTOMATION: ${{ vars.BETA_AUTOMATION }} + run: | + if [ "$BETA_AUTOMATION" = enabled ]; then + echo "enabled=true" >> "$GITHUB_OUTPUT" + else + echo "Scheduled betas are paused: BETA_AUTOMATION is '${BETA_AUTOMATION:-<unset>}', not 'enabled'. Nothing was done." >> "$GITHUB_STEP_SUMMARY" + fi + + cut: + needs: gate + if: needs.gate.outputs.enabled == 'true' + runs-on: ubuntu-latest + timeout-minutes: 30 + environment: beta-automation + # Shared with the continuation, so only one scheduler step acts at a time. + concurrency: + group: beta-scheduler + cancel-in-progress: false + permissions: + contents: read + issues: write + packages: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + fetch-depth: 0 + persist-credentials: false + - name: Mint the release-bot token + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + # The token's JWT issuer may be the App ID or the client ID. + client-id: ${{ vars.RELEASE_BOT_APP_ID }} + private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} + permission-actions: write + permission-contents: write + permission-workflows: write + - name: Advance the beta line + id: scheduler + env: + RELEASE_BOT_TOKEN: ${{ steps.app-token.outputs.token }} + RELEASE_BOT_SLUG: ${{ steps.app-token.outputs.app-slug }} + GITHUB_TOKEN: ${{ github.token }} + PUBLIC_READ_TOKEN: ${{ github.token }} + run: python3 .github/scripts/beta-scheduler.py cut + - name: Record an unreported failure + if: failure() && steps.scheduler.outputs.alerted != 'true' + env: + GITHUB_TOKEN: ${{ github.token }} + run: python3 .github/scripts/beta-scheduler.py alert --stage cut --reason "The beta-cut job failed before the scheduler reported a result." |
