Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

AttributeError: 'WorkflowMultiBranchProject' object has no attribute 'build' #2

Open
mbonaci opened this issue Oct 4, 2022 · 0 comments

Comments

@mbonaci
Copy link

mbonaci commented Oct 4, 2022

JENKINS_ACTION: Successfully connected to Jenkins.
Traceback (most recent call last):
  File "/app/main.py", line 102, in <module>
    main()
  File "/app/main.py", line 58, in main
    queue_item = jenkins.build_job(job_name, **parameters)
  File "/app/api4jenkins/__init__.py", line 194, in build_job
    return job.build(**params)
  File "/app/api4jenkins/item.py", line [13](https://github.com/my_org/my_private_repo/actions/runs/3182694153/jobs/5188971884#step:3:14)2, in __getattr__
    return super().__getattribute__(name)
AttributeError: 'WorkflowMultiBranchProject' object has no attribute 'build'

This is the action definition:

name: Trigger jenkins job

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Jenkins
        uses: joshlk/jenkins-githubaction@master
        with:
          url: https://jenkins.my_domain.com
          job_name: my_jenkins_pipeline_job_name
          username: ${{secrets.JENKINS_USER}}
          api_token: ${{secrets.JENKINS_TOKEN}}
          # 45 min timeout to finish the build
          timeout: 2700
          # query Jenkins API for the job status every 10s
          interval: 10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant