Repository navigation
58 lines (49 loc) Β· 1.76 KB
/
Copy pathpublish.yml
File metadata and controls
58 lines (49 loc) Β· 1.76 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Publish Updates to Production
on:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
steps:
- name: π Setup repo
uses: actions/checkout@v4
- name: π Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: π Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: π¦ Install dependencies
run: npm ci
- name: π Create update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get the commit message
MESSAGE=$(git log -1 --pretty=%B)
# Get the PR number from the merge commit message
PR_NUMBER=$(echo "$MESSAGE" | sed -n 's/.*#\([0-9]*\).*/\1/p' | head -1)
# If we found a PR number, check for critical label
if [ ! -z "$PR_NUMBER" ]; then
# Get PR labels using GitHub API
LABELS=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/${{ github.repository }}/issues/$PR_NUMBER" | \
jq -r '.labels[].name')
echo "PR Labels: $LABELS"
# Check if "critical" label exists
if echo "$LABELS" | grep -iq "critical"; then
echo "Critical label found - prepending CRITICAL to message"
MESSAGE="CRITICAL: $MESSAGE"
fi
fi
# Use our custom publish script that embeds the message in app.config.js
npm run publish:update -- --message "$MESSAGE" --channel production --environment production