Skip to content
arrow-right-circle

GitHub Action

Build Jenkins job

1.0.0 Latest version

Build Jenkins job

arrow-right-circle

Build Jenkins job

Trigger jenkins job

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Build Jenkins job

uses: GoldenspearLLC/build-jenkins-job@1.0.0

Learn more about this action in GoldenspearLLC/build-jenkins-job

Choose a version

Build jenkins job from Github Action 🚀

This action builds/triggers a jenkins job, waiting it to be finished and enabling to pass job params.

Inputs

jenkins-token

Required

jenkins-url

Required

jenkins-user

Required

job-path

Required

E.g.

if job inside folder:
 "job/folder_name/job/job_name"

if job in jenkins root: 
 "job/job_name"

job-params

Not mandatory

Set jenkins params as JSON string:

E.g.

 "{'param1': 'value1', 'param2': 'value2'}"

Outputs

status/result

  • FAILURE
  • SUCCESS
  • ABORTED

Example usage

    - name: "Trigger jenkins job"
      uses: GoldenspearLLC/build-jenkins-job@master
      with:
        jenkins-url: ${{ secrets.JENKINS_URL }}
        jenkins-token: ${{ secrets.JENKINS_TOKEN }}
        user: "jenkins-username"
        job-path: "job/folder_name/job/job_name"
        job-params: "{'param1': 'value1', 'param2': 'value2'}"
    - name: Get job status
      run: echo "Job status is ${{ steps.job-build.outputs.job_status }}"