Auto Updater #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Updater | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
daily-auto-update: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: github.repository == 'react-native-community/reproducer-react-native' | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Check React Native Version | |
id: yarnoutdated | |
working-directory: ReproducerApp | |
run: yarn outdated react-native | |
continue-on-error: true | |
- name: Re-create the reproducer | |
id: recreate | |
if: steps.yarnoutdated.outcome == 'failure' | |
run: | | |
rm -rf ReproducerApp | |
npx react-native@latest init ReproducerApp --skip-install | |
cd ReproducerApp | |
yarn | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add --all | |
git commit -m "Update reproducer to latest React Native version" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
if: steps.yarnoutdated.outcome == 'failure' | |
with: | |
branch: main | |
github_token: ${{ secrets.GITHUB_TOKEN }} |