Run pipeline job only on non-forked version (OD-2245)
Andreas Mack opened 1 year ago

I have forked a project into my namespace. This project has a pipeline that has two jobs: "build" and "publish". How can I make sure in the onedev-buildspec that "publish" should only run in the main, non-forked repo. "Build" should run also in my forked version.

  • Robin Shen commented 1 year ago

    Make the publish job accessing a job secret defined in main project. Forked projects will not copy the secret, and the publish job will fail if requested to run.

  • Andreas Mack commented 1 year ago

    Is there no other way? I always see failures in my (private) builds.

  • Robin Shen commented 12 months ago

    If this is a scheduled job, you may configure the trigger to only fire for applicable projects.

  • Andreas Mack commented 12 months ago

    No, pipeline is triggered from branch update. Would it be possible to make the condition of the post-build action "Run job publish" be "successful AND projectpath starts with 'main/"' ?

  • Robin Shen commented 12 months ago

    An improvement request added to able to filter projects in post-action condition: OD-2248

    Another approach is not to trigger publish job via post-job action. Instead, make publish job depends on build job, and then configure a "dependency job finished" tirgger for the publish job and specify applicable projects of the trigger.

  • Robin Shen changed state to 'Closed' 12 months ago
    Previous Value Current Value
    Open
    Closed
  • Andreas Mack commented 12 months ago

    It works in the new version. Thank you!

issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2245
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover