Promote Beta/Experimental opt-in Channels #199
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
# Promotes the current Nightly channel to Beta/Experimental opt-in on a schedule. | |
name: Promote Beta/Experimental opt-in Channels | |
on: | |
schedule: | |
# 1:30 a.m. PST / 12:30 a.m. PDT, Tuesdays. | |
- cron: '30 1 * * 2' | |
workflow_dispatch: | |
inputs: | |
amp-version: | |
description: 'AMP version number (13 digits)' | |
required: false | |
default: '' | |
type: string | |
auto-merge: | |
description: 'Enable PR auto-merge' | |
required: false | |
type: boolean | |
jobs: | |
promote-beta-experimental-opt-in: | |
uses: ampproject/cdn-configuration/.github/workflows/promote-reusable-workflow.yml@main | |
with: | |
channel-name: 'Beta/Experimental opt-in' | |
ts-file: 'promote-beta-experimental-opt-in.ts' | |
amp-version: ${{ github.event.inputs.amp-version }} | |
auto-merge: ${{ github.event.inputs.auto-merge }} | |
secrets: | |
access-token: ${{ secrets.ACCESS_TOKEN }} | |
get-missing-cherry-picks: | |
needs: promote-beta-experimental-opt-in | |
runs-on: ubuntu-latest | |
outputs: | |
fixes: ${{ steps.get-fixes.outputs.fixes }} | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: npm ci | |
- name: Get fixes | |
id: get-fixes | |
run: npx tsx ./scripts/get-missing-cherry-picks-job.ts --amp_version="${{ github.event.inputs.amp-version }}" | |
cherry-pick-if-missing: | |
needs: get-missing-cherry-picks | |
if: needs.get-missing-cherry-picks.outputs.fixes | |
uses: ampproject/cdn-configuration/.github/workflows/cherry-pick.yml@main | |
with: | |
amp-version: ${{ github.event.inputs.amp-version }} | |
shas: ${{ needs.get-missing-cherry-picks.outputs.fixes }} | |
secrets: | |
access-token: ${{ secrets.ACCESS_TOKEN }} | |
create-issue-on-error: | |
if: failure() | |
needs: get-missing-cherry-picks | |
permissions: | |
contents: read | |
issues: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | |
- name: Create issue on error | |
uses: JasonEtco/create-an-issue@v2 | |
with: | |
filename: .github/create_issue_on_error.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
WORKFLOW_NAME: ${{ github.workflow }} | |
MENTION: '@ampproject/release-on-duty' | |
REPO_SLUG: ${{ github.repository }} | |
RUN_ID: ${{ github.run_id }} |