> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/open-source/use-harness-open-source/pipelines-1/expressions.md).

# Expressions

Expressions provide dynamic values to your pipeline at runtime.

Harness Open Source provides [variables](https://github.com/iKettles/harness-gitbook/tree/main/open-source/use-harness-open-source/reference/pipelines/expression_variables.md) that can be referenced in expressions and [conditions](/open-source/use-harness-open-source/pipelines-1/conditions.md). Expressions are also used to reference [secrets](/open-source/use-harness-open-source/pipelines-1/secrets.md).

## Variables <a href="#variables" id="variables"></a>

Variables can be referenced throughout your pipeline with the expression syntax `${{ variable.name }}`.

This pipeline sends a message to slack containing the [build number](https://github.com/iKettles/harness-gitbook/tree/main/open-source/use-harness-open-source/reference/pipelines/expression_variables.md#buildnumber) after the `test` step completes.

```yaml
kind: pipeline
spec:
  stages:
  - type: ci
    spec:
      steps:
      - name: test
        type: run
        spec:
          container: maven:3-jdk-10
          script: |-
            mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V

      - name: notify
        type: plugin
        spec:
          name: slack
          inputs:
            template: build number ${{ build.number }} completed
            webhook: ${{ secrets.get("slack_webhook") }}
```

This pipeline prints all files changed in the commit range based on the [before](https://github.com/iKettles/harness-gitbook/tree/main/open-source/use-harness-open-source/reference/pipelines/expression_variables.md#buildbefore) and [after](https://github.com/iKettles/harness-gitbook/tree/main/open-source/use-harness-open-source/reference/pipelines/expression_variables.md#buildafter) commits.

```yaml
kind: pipeline
spec:
  stages:
  - type: ci
    spec:
      steps:
      - name: print files changed
        type: run
        spec:
          container: alpine/git
          script: |-
            git diff --name-only ${{ build.before }}..${{ build.after }} > files_changed.txt

            for FILE in $(cat files_changed.txt); do
              echo $FILE was changed
            done
```
