Skip to content

feat: standalone pelican tests across accounts with shared sending #142

feat: standalone pelican tests across accounts with shared sending

feat: standalone pelican tests across accounts with shared sending #142

name: Upstream Auto Release

Check warning on line 1 in .github/workflows/upstream-auto-release.yml

View workflow run for this annotation

GitHub Actions / Upstream Auto Release

Workflow execution policy warning (evaluate mode)

On November 2, 2026, GitHub will restrict `pull_request_target` on public repositories by default. To continue allowing the event trigger, configure an Actions policy. Learn more: https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target
on:
pull_request_target:
types: [closed]
permissions:
actions: write
contents: write
issues: write
concurrency:
group: upstream-auto-release
cancel-in-progress: false
jobs:
tag:
if: >-
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.head.ref, 'sync/upstream-') &&
contains(github.event.pull_request.labels.*.name, 'upstream-safe-candidate')
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Resume the checked promotion pipeline
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
[[ "$PR_NUMBER" =~ ^[1-9][0-9]*$ ]]
gh workflow run upstream-promote.yml --repo "$GITHUB_REPOSITORY" --ref main \
-f pr_number="$PR_NUMBER" -f confirmation=PROMOTE
- name: Create or update failure issue
if: failure()
env:
TITLE: Upstream automatic release failed
RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
shell: bash
run: |
set -euo pipefail
gh label create --repo "$GITHUB_REPOSITORY" upstream-automation-failed --color B60205 --description 'Upstream automation stopped without production change' --force
body=$(mktemp)
printf 'Automatic tagging stopped. Production was not changed.\n\nRun: %s\n' "$RUN_URL" >"$body"
issue=$(gh issue list --repo "$GITHUB_REPOSITORY" --state open --search "${TITLE} in:title" --json number,title --jq ".[] | select(.title == \"${TITLE}\") | .number" | head -n1)
if [[ -n "$issue" ]]; then
gh issue edit "$issue" --repo "$GITHUB_REPOSITORY" --body-file "$body" --add-label upstream-automation-failed
else
gh issue create --repo "$GITHUB_REPOSITORY" --title "$TITLE" --body-file "$body" --label upstream-automation-failed
fi