From db2f84c067d7bd09fa0b25b5f283703c4d8a2285 Mon Sep 17 00:00:00 2001 From: Okan Sahin Date: Thu, 25 Apr 2024 13:09:43 +0200 Subject: [PATCH] test --- .github/workflows/merge-to-stage.js | 11 +++++++++-- .github/workflows/merge-to-stage.yaml | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/merge-to-stage.js b/.github/workflows/merge-to-stage.js index 493764efc7..beb65f74d3 100644 --- a/.github/workflows/merge-to-stage.js +++ b/.github/workflows/merge-to-stage.js @@ -104,6 +104,12 @@ const getReviews = ({ pr }) => return pr; }); +const hasFailingChecks = (checks) => + checks.some( + ({ conclusion, name }) => + name !== 'merge-to-stage' && conclusion === 'failure' + ); + const getPRs = async () => { let prs = await github.rest.pulls .list({ owner, repo, state: 'open', per_page: 100, base: 'stage' }) @@ -117,7 +123,7 @@ const getPRs = async () => { ]); prs = prs.filter(({ checks, reviews, html_url, number, title }) => { - if (checks.some(({ conclusion }) => conclusion === 'failure')) { + if (hasFailingChecks(checks)) { slackNotification( `:x: Skipping <${html_url}|${number}: ${title}> due to failing checks` ); @@ -177,7 +183,8 @@ const openStageToMainPR = async () => { base: 'main', head: 'stage', }); - if (data.status !== 'divergent') return console.log('Stage&Main are equal'); + + if (data.status === 'identical') return console.log('Stage&Main are equal'); const { data: pr } = await github.rest.pulls.create({ owner, diff --git a/.github/workflows/merge-to-stage.yaml b/.github/workflows/merge-to-stage.yaml index 3d857c9084..2ea82b224b 100644 --- a/.github/workflows/merge-to-stage.yaml +++ b/.github/workflows/merge-to-stage.yaml @@ -11,7 +11,7 @@ env: MILO_RELEASE_SLACK_WH: ${{ secrets.MILO_RELEASE_SLACK_WH }} jobs: - update: + merge-to-stage: runs-on: ubuntu-latest steps: