Release tagger #366
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 tagger | |
on: | |
workflow_dispatch: | |
inputs: | |
action: | |
description: 'tagger action (promote | rollback)' | |
required: true | |
head: | |
description: 'head AMP version' | |
required: true | |
base: | |
description: 'base AMP version' | |
required: true | |
channel: | |
description: 'release channel (beta-opt-in | beta-percent | stable | lts)' | |
required: true | |
sha: | |
description: 'commit sha' | |
required: true | |
permissions: | |
contents: read | |
jobs: | |
tagger: | |
environment: release_tagger | |
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 | |
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 | |
with: | |
node-version: lts/* | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
- run: bash ./.github/workflows/install_dependencies.sh | |
- name: Run tagger | |
run: | | |
node ./build-system/release-tagger/index.js \ | |
--action ${{ github.event.inputs.action }} \ | |
--head ${{ github.event.inputs.head }} \ | |
--base ${{ github.event.inputs.base }} \ | |
--channel ${{ github.event.inputs.channel }} \ | |
--sha ${{ github.event.inputs.sha }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.AMPPROJECTBOT }} | |
create-issue-on-error: | |
if: failure() | |
needs: tagger | |
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@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
- 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/wg-infra' | |
REPO_SLUG: ${{ github.repository }} | |
RUN_ID: ${{ github.run_id }} |