Cut Nightly Branch #34
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
# Cuts a new nightly branch on a schedule. | |
name: Cut Nightly Branch | |
on: | |
schedule: | |
# 1 a.m. PST / 12 a.m. PDT, Tuesdays through Saturdays. | |
- cron: '0 8 * * 2-6' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
cut-nightly: | |
environment: cut_nightly | |
if: github.repository == 'ampproject/amphtml' | |
name: Cut Nightly Branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 | |
with: | |
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- name: Checkout Repo | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 100 | |
- name: Set Up Node | |
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 | |
with: | |
node-version: lts/* | |
- name: Set Up Environment | |
run: sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share} | |
- name: Install Dependencies | |
run: npm ci | |
- name: ⭐ Cut Nightly Branch ⭐ | |
run: node --unhandled-rejections=strict build-system/release-workflows/cut-nightly.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.AMPPROJECTBOT }} | |
create-issue-on-error: | |
if: failure() | |
needs: cut-nightly | |
permissions: | |
contents: read | |
issues: write | |
runs-on: ubuntu-latest | |
environment: create_issue_on_error | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 | |
with: | |
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Create issue on error | |
uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd # v2.9.1 | |
with: | |
filename: .github/create_issue_on_error.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.AMPPROJECTBOT }} | |
WORKFLOW_NAME: ${{ github.workflow }} | |
MENTION: '@ampproject/release-on-duty' | |
REPO_SLUG: ${{ github.repository }} | |
RUN_ID: ${{ github.run_id }} |