Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mokimo committed Apr 25, 2024
1 parent 3321601 commit db2f84c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/merge-to-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand All @@ -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`
);
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-to-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
MILO_RELEASE_SLACK_WH: ${{ secrets.MILO_RELEASE_SLACK_WH }}

jobs:
update:
merge-to-stage:
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit db2f84c

Please sign in to comment.