Github Action not getting triggered

Viewed 1468

I want to use Github Action to trigger Jenkins build, when PR on develop branch is merged with changes in frontend/ dir. I have following file in .github/workflows/ if the repo

name: Trigger Jenkins Build [ Build-Portal ]
on:
  push:
    branches: [ develop ]
    paths: 'frontend/**'
    types: [closed]
jobs:
  build:
    name: Triggering Jenkins Build [ Build-Portal ]
    runs-on: ubuntu-latest
    if: github.event.pull_request.merged == true
    steps:
    - name: Trigger Build-Portal
      uses: actions/trigger-jenkins@develop
      with:
        jenkins_url: "http://jenkins.example.net:8080/"
        jenkins_user: ${{ secrets.JENKINS_USER }}
        jenkins_token: ${{ secrets.JENKINS_USER_TOKEN }}
        job_name: "Build-Portal"
        job_params: '{"FRESH_BUILD":"True", "UI":"True", "BUILD_BRANCH":"develop", "DEPLOY_DEV":"True"}'
        job_timeout: "3600" # Default 30 sec. (optional)

But I don't see this is getting triggered under tab /actions

I updated above workflow to

name: Trigger Jenkins Build [ Build-Portal ]
on:
  pull_request:
    branches: [ develop ]
    types: [ closed ]
jobs:
  trigger:
    name: Triggering Jenkins Build [ Build-Portal ]
    runs-on: ubuntu-latest
    steps:
    - name: Triggering Jenkins Build
      uses: appleboy/jenkins-action@master
      if: github.event.pull_request.merged == true
      with:
        url: "http://jenkins.example.net:8080/"
        user: ${{ secrets.JENKINS_USER }}
        token: ${{ secrets.JENKINS_USER_TOKEN }}
        job: "Build-Portal"

with these changes, workflow is running, but getting failure with missing jenkins config

Run appleboy/jenkins-action@master
  with:
    url: http://jenkins.example.net:8080/
    job: Build-Portal
/usr/bin/docker run --name a33c102b3a03f81d04bc7936bf41daf1ca949_52143d --label 8a33c1 --workdir /github/workspace --rm -e INPUT_URL -e INPUT_USER -e INPUT_TOKEN -e INPUT_JOB -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/Build-Portal/Build-Portal":"/github/workspace" 8a33c1:02b3a03f81d04bc7936bf41daf1ca949
2021/06/16 14:16:24 missing jenkins config

What I am missing here ?

0 Answers
Related