jobs.<job_id>.steps[*].with

1 minute read

Use jobs.<job_id>.steps[*].with to pass key/value pair inputs to an action. The with keyword is also used in the context of a command step, when the uses value is a container image, rather than an action.

with specifications:

  • Each input parameter is a key/value pair.

  • Each variable is converted to upper case.

Non-alphanumeric characters are converted to _ (underscore).

When the uses value is a Docker image (docker://), you can use with to map input parameters that are set as environment variables, for example:

  • with.env

  • with.entrypoint

  • with.args

Example usage: actions

In the following example, the job step configures an action, cloudbees-io/jenkins-run-job@v2. The with keyword passes in action inputs.

jobs: my-jenkins-job: steps: - name: My Jenkins job uses: cloudbees-io/jenkins-run-job@v2 with: username: ${{ secrets.JENKINS_USERNAME }} token: ${{ secrets.JENKINS_TOKEN }} url: ${{ vars.JENKINS_URL }} job-name: my_jenkins_job parameters: '{"ENV_NAME":"DEV"}'