From 0264c36dcd3caab296d1edd5b7146697942529c5 Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 18 Jul 2024 04:12:33 -0700 Subject: [PATCH] Add ci job to check if nightly succeeded (#45509) Summary: This change adds a job that runs 2 hours after the nightlies. This jobs returns successfully if the nightly has been published or it report an error in case it has failed. We will hook this signal to the internal system to be notified about Nightlies failures ## Changelog: [Internal] - Add jobs to check for nightlies Pull Request resolved: https://github.com/facebook/react-native/pull/45509 Test Plan: Test the Action on GHA Reviewed By: blakef Differential Revision: D59907442 Pulled By: cipolleschi fbshipit-source-id: 3b35aa2ad69b376c65a765f740a1d6e6ed8ad99f --- .github/workflows/check-nightly.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/check-nightly.yml diff --git a/.github/workflows/check-nightly.yml b/.github/workflows/check-nightly.yml new file mode 100644 index 00000000000..2fb26d10811 --- /dev/null +++ b/.github/workflows/check-nightly.yml @@ -0,0 +1,26 @@ +# This jobs runs every day 2 hours after the nightly job and its purpose is to report +# a failure in case the nightly failed to be published. We are going to hook this to an internal automation. +name: Check Nigthlies + +on: + workflow_dispatch: + # nightly build @ 4:15 AM UTC + schedule: + - cron: '15 4 * * *' + +jobs: + check-nightly: + runs-on: ubuntu-latest + if: github.repository == 'facebook/react-native' + steps: + - name: Check nightly + run: | + TODAY=$(date "+%Y%m%d") + echo "Checking nightly for $TODAY" + NIGHTLY="$(npm view react-native | grep $TODAY)" + if [[ -z $NIGHTLY ]]; then + echo 'Nightly job failed.' + exit 1 + else + echo 'Nightly Worked, All Good!' + fi