Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(2675): exclude ci build for non-pr #25489

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,13 @@ workflows:
- trigger-beta-build:
requires:
- prep-deps
- check-pr-tag
- prep-deps
- validate-pr-for-mmi:
requires:
- check-pr
- check-pr
- prep-deps:
requires:
- check-pr
- get-changed-files-with-git-diff:
<<: *exclude_develop_master_rc
requires:
Expand Down Expand Up @@ -178,7 +183,7 @@ workflows:
- prep-build-test-mmi-playwright:
requires:
- prep-deps
- check-pr-tag
- validate-pr-for-mmi
- prep-build-storybook:
requires:
- prep-deps
Expand All @@ -188,7 +193,9 @@ workflows:
- test-lint:
requires:
- prep-deps
- test-lint-shellcheck
- test-lint-shellcheck:
requires:
- check-pr
- test-lint-lockfile:
requires:
- prep-deps
Expand Down Expand Up @@ -413,7 +420,28 @@ jobs:
name: Create GitHub Pull Request for version
command: .circleci/scripts/release-create-release-pr.sh

check-pr-tag:
check-pr:
docker:
- image: cimg/base:stable
steps:
- run:
name: Check if branch has a linked PR
command: |
#!/bin/bash
# Validate if branch is master, develop or release branch
if [[ "$CIRCLE_BRANCH" =~ ^(develop|master|Version-v[0-9]+\.[0-9]+\.[0-9]+|trigger-ci.*)$ || -n "$CIRCLE_PULL_REQUESTS" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] can you include a mention of trigger-ci.* in the comment?

echo "Branch matches filters. Proceeding with pipeline."
else
if [ -z "$CIRCLE_PULL_REQUESTS" ]; then
echo "This branch has no associated pull request. Terminating pipeline build."
exit 1
else
echo "Branch does not match filters. Terminating pipeline build."
fi
exit 1
fi

validate-pr-for-mmi:
docker:
- image: cimg/base:stable
steps:
Expand All @@ -423,12 +451,6 @@ jobs:
#!/bin/bash

GH_LABEL=team-mmi
if [ -z "$CIRCLE_PULL_REQUESTS" ]; then
echo "Skipping tag check; this is not a PR."
echo "false" > ./RUN_MMI_OPTIONAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't the fact that we don't assign ./RUN_MMI_OPTIONAL anymore substantially change the script?

exit 0
fi

echo $CIRCLE_PULL_REQUESTS | sed 's/,/\n/g'

# See if any associated PRs have matching label
Expand Down