forked from akaffenberger/firebase-ios-sdk-xcframeworks
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.38 KB
/
create_release_branch.yml
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
45
name: Create Release Branch
on:
workflow_dispatch:
schedule:
# Every day at 05:00 EST (10:00 UTC)
- cron: '0 10 * * *'
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get latest Firebase release
id: latest_firebase_release
run: |
latest_firebase_release=$(gh release view --repo $REPO --json tagName --jq '.tagName')
echo "::set-output name=latest_firebase_release::${latest_firebase_release}"
env:
REPO: firebase/firebase-ios-sdk
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if branch exists
id: check_branch
run: |
git fetch origin
if git ls-remote --heads origin "$BRANCH" | grep -q "$BRANCH"; then
echo "::set-output name=branch_exists::true"
else
echo "::set-output name=branch_exists::false"
fi
env:
BRANCH: release/${{ steps.latest_firebase_release.outputs.latest_firebase_release }}
- name: Create release branch
if: steps.check_branch.outputs.branch_exists == 'false'
run: |
git checkout -b $BRANCH
git push origin $BRANCH
env:
BRANCH: release/${{ steps.latest_firebase_release.outputs.latest_firebase_release }}
GITHUB_TOKEN: ${{ secrets.AFRESHY_PAT }}