Skip to content

Commit

Permalink
fix-default-branch-name: to main (#91)
Browse files Browse the repository at this point in the history
Co-authored-by: Emma Doyle <[email protected]>
  • Loading branch information
emmeowzing and Emma Doyle authored Aug 21, 2023
1 parent f7403a4 commit 63a6692
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .circleci/src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ workflows:
- github
filters:
branches:
ignore: master
ignore: main
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository:
topics: circleci, orb, continuation, CI/CD, continuous integration

branches:
- name: master
- name: main
protection:
required_status_checks:
strict: true
Expand Down
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Get up-and-running with dynamically continued pipelines in these 4 steps:
The orb will run a workflow (we'll call it `<module>`) if any of the following conditions are met.

1. If `.circleci/<module>.yml` changes (this is configurable, enabled by default).
2. If changes have been detected within the `<module>/`'s directory on your branch against the repository's default branch (defaults to `master`). See [below](#filtering-or-ignoring-changed-files) on how to filter out CI runs from specific changed files.
2. If changes have been detected within the `<module>/`'s directory on your branch against the repository's default branch (defaults to `main`). See [below](#filtering-or-ignoring-changed-files) on how to filter out CI runs from specific changed files.
3. If, following merge to the default branch, there are changes to `.circleci/<module>.yml` or under `<module>/`, when diffing against the former commit (you must perform a merge commit for this to work properly).

These conditions can be overridden, and all workflows forced to run, if the `force-all` parameter is set to `true` on the `continue` job.
Expand Down Expand Up @@ -236,13 +236,6 @@ Append the following to your `.pre-commit-config.yaml` -

You must have the [`circleci`](https://circleci.com/docs/2.0/local-cli/) CLI installed.

## Live Examples of dynamic-continuation

I use and test this orb in my own projects.

- [`minikube`](https://github.com/bjd2385/minikube/tree/master/.circleci) - this is a simple example with basic configs.
- [this repo](.circleci/) - that's right, this repo uses it as well!

## Development

This orb has been developed in _unpacked_ form. You may view its packed source with
Expand Down
2 changes: 1 addition & 1 deletion src/commands/filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ parameters:
default-branch:
description: The default branch of the repository.
type: string
default: master
default: main
wildmatch-version:
description: Wildmatch package version to install. For available versions, check PyPI - https://pypi.org/project/wildmatch/
type: string
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/filter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ $SH_MODULES
fi


# Add each module to `modules-filtered` if 1) `force-all` is set to `true`, or 2) there is a diff against master at HEAD, or 3) no workflow runs have occurred on the default branch for this project in the past $SH_REPORTING_WINDOW days.
# Add each module to `modules-filtered` if 1) `force-all` is set to `true`, or 2) there is a diff against main at HEAD, or 3) no workflow runs have occurred on the default branch for this project in the past $SH_REPORTING_WINDOW days.
if [ "$SH_FORCE_ALL" -eq 1 ] || { [ "$SH_REPORTING_WINDOW" != "" ] && [ "$(curl -s -X GET --url "https://circleci.com/api/v2/insights/${SH_PROJECT_TYPE}/${_CIRCLE_ORGANIZATION}/${CIRCLE_PROJECT_REPONAME}/workflows?reporting-window=${SH_REPORTING_WINDOW}" --header "Circle-Token: ${_CIRCLE_TOKEN}" | jq -r "[ .items[].name ] | length")" -eq "0" ]; }; then
info "running all workflows."
printf "%s" "$SH_MODULES" | awk NF | while read -r module; do
Expand Down

0 comments on commit 63a6692

Please sign in to comment.