Skip to content

Test color override in preview #8

Test color override in preview

Test color override in preview #8

# Preview routing for demo-db-rollback-routing.
#
# A GitHub PR label lives on the PR object; Kargo git subscriptions can only
# see things that live in git (branches, tags, commit metadata, paths). So the
# label is the trigger and a git tag is the artifact: labeling a PR
# `deploy-preview` tags its head as preview-<PR#>, which the `preview`
# Warehouse discovers via allowTagsRegexes.
name: dbr-preview-tag
on:
pull_request:
types: [labeled, synchronize, closed]
permissions:
contents: write
jobs:
tag:
if: >-
github.event.action != 'closed' &&
contains(github.event.pull_request.labels.*.name, 'deploy-preview')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: tag PR head for preview
run: |
git tag -f preview-${{ github.event.pull_request.number }} ${{ github.event.pull_request.head.sha }}
git push origin preview-${{ github.event.pull_request.number }} --force
cleanup:
if: github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: delete preview tag
run: |
git push origin :refs/tags/preview-${{ github.event.pull_request.number }} || true