forked from langfuse/langfuse
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.19 KB
/
promote-main-to-production.yml
File metadata and controls
44 lines (38 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Promote Main to Production
on:
workflow_dispatch:
inputs:
confirm:
description: "Type 'promote' to confirm force-pushing main to production"
required: true
type: string
concurrency:
group: promote-main-to-production
cancel-in-progress: false
jobs:
promote:
runs-on: ubuntu-latest
environment: "protected branches"
steps:
- name: Validate confirmation
run: |
if [ "${{ github.event.inputs.confirm }}" != "promote" ]; then
echo "Input 'confirm' must be 'promote'."
exit 1
fi
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Print commit refs
run: |
git fetch origin main production
echo "main: $(git rev-parse origin/main)"
if git show-ref --verify --quiet refs/remotes/origin/production; then
echo "production (before): $(git rev-parse origin/production)"
else
echo "production (before): <branch does not exist>"
fi
- name: Force push main to production
run: git push origin +main:production