File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Recreate Staging Branch
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ recreate-staging :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
19+ token : ${{ secrets.GITHUB_TOKEN }}
20+
21+ - name : Check if staging branch exists
22+ id : check-staging
23+ run : |
24+ if git ls-remote --heads origin staging | grep -q staging; then
25+ echo "exists=true" >> $GITHUB_OUTPUT
26+ else
27+ echo "exists=false" >> $GITHUB_OUTPUT
28+ fi
29+
30+ - name : Recreate staging branch
31+ if : steps.check-staging.outputs.exists == 'false'
32+ run : |
33+ git config user.name "github-actions[bot]"
34+ git config user.email "github-actions[bot]@users.noreply.github.com"
35+ git checkout -b staging
36+ git push origin staging
You can’t perform that action at this time.
0 commit comments