Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/recreate-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Recreate Staging Branch

on:
push:
branches:
- main

permissions:
contents: write

jobs:
recreate-staging:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check if staging branch exists
id: check-staging
run: |
if git ls-remote --heads origin staging | grep -q staging; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Recreate staging branch
if: steps.check-staging.outputs.exists == 'false'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b staging
git push origin staging