← Back to Explore

artifact-selector-query-filter

Fixture demonstrating rd:// selector query filters end-to-end through the CLI.

test artifacts

Rundown

# Artifact Selector Query Filter

Selectors only address the current run's context, so this fixture produces an
artifact in step 1 and then filters it in step 2 through the run's own
`{{ ContextId }}`. A single run-wildcard `*` with an exact key keeps each literal
URI free of a markdown-emphasis `*...*` pair.

## 1. Produce plan

- ARTIFACTS
  - PlanA "plan-a.json"
- PASS CONTINUE
- FAIL STOP

```bash
printf '{}' > "{{ path PlanA }}"
```

## 2. Filter the produced artifact

- ARTIFACTS
  - MatchedSource "rd://artifacts/{{ ContextId }}/*/plan-a.json?source=project"
  - ExcludedSource "rd://artifacts/{{ ContextId }}/*/plan-a.json?source=plugin"
  - MatchedCreated "rd://artifacts/{{ ContextId }}/*/plan-a.json?createdAfter=2020-01-01T00:00:00.000Z"
  - ExcludedCreated "rd://artifacts/{{ ContextId }}/*/plan-a.json?createdBefore=2020-01-01T00:00:00.000Z"
- PASS COMPLETE

```bash
rd echo --result pass
```

Run

Initializing...

Initializing...

Step/2