Skip to content

Commit

Permalink
Merge pull request #2 from yibo-long/alpha
Browse files Browse the repository at this point in the history
Add additional param to trigger freely
  • Loading branch information
yibo-long authored Jan 27, 2023
2 parents 5b54db1 + 3ff03b6 commit c2c3cf8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/commands/filter-to-continue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ parameters:
type: string
default: "circleci.com"
description: "The domain of the CircleCI installation - defaults to circleci.com."
trigger-path:
type: string
default: ""
description: >
Optional additional path to trigger as a parameter, so it can be directly triggered from CircleCI console.
steps:
- checkout
- run:
Expand All @@ -30,5 +35,6 @@ steps:
BASE_REVISION: <<parameters.base-revision>>
CIRCLECI_DOMAIN: <<parameters.circleci-domain>>
PROJECT_CONFIG_PATH: <<parameters.project-config-path>>
ADDITIONAL_TRIGGER_PATH: <<parameters.trigger-path>>
shell: /usr/bin/env python3
command: <<include(scripts/create-config.py)>>
6 changes: 6 additions & 0 deletions src/jobs/filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ parameters:
description: >
Pick a specific circleci/python image variant:
https://hub.docker.com/r/cimg/python/tags
trigger-path:
type: string
default: ""
description: >
Optional additional path to trigger as a parameter, so it can be directly triggered from CircleCI console.
steps:
- checkout
- filter-to-continue:
base-revision: << parameters.base-revision >>
circleci-domain: << parameters.circleci-domain >>
project-config-path: << parameters.project-config-path >>
trigger-path: << parameters.trigger-path >>
3 changes: 3 additions & 0 deletions src/scripts/create-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ def create_config(head, base):

print('Comparing {}...{}'.format(base, head))
changes = changed_files(base, head)
additional_trigger_path = os.environ.get('ADDITIONAL_TRIGGER_PATH', '')
if additional_trigger_path:
changes.append(additional_trigger_path)
config_paths = scan_configs()
final_config = {
'version': 2.1,
Expand Down

0 comments on commit c2c3cf8

Please sign in to comment.