Skip to content

(manual PR) Upgrade expo SDK #3

(manual PR) Upgrade expo SDK

(manual PR) Upgrade expo SDK #3

name: (manual PR) Upgrade expo SDK
on:
workflow_dispatch:
jobs:
publish:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: Install dependencies
uses: ./.github/actions/install
- name: Set env
run: |
BRANCH_NAME="upgrade-expo-sdk-$(date "+%Y%m%d%H%M%S")"
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
- name: Upgrade Expo
working-directory: example
run: |
npm --global install expo-cli@latest
npx expo upgrade --non-interactive
- name: Config git
run: |
git config --local user.email "[email protected]"
git config --local user.name "RNEUI"
- name: Checkout
run: |
git add .
git commit -m "Upgrade Expo SDK"
git checkout -b ${{ env.BRANCH_NAME }}
git push --set-upstream origin ${{ env.BRANCH_NAME }} --force
- name: Create Pull Request
continue-on-error: true
uses: actions/github-script@v6
with:
script: |
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'example: upgrade expo SDK to latest',
owner,
repo,
head: '${{ env.BRANCH_NAME }}',
base: 'next',
body: [
'This PR is auto-generated by',
'[actions/github-script](https://github.com/actions/github-script).'
].join('\n')
});
github.rest.issues.addLabels({
owner,
repo,
issue_number: result.data.number,
labels: ['feature', 'automated pr', 'need-review']
});