I’m currently setting up a pipeline that gets triggered by a pull request. Once the pipeline starts, tests are ran. After the tests successfully run, I have a script that I want to approve the PR. When I attempt to set this pipeline using the fly
command I get the following error:
invalid jobs: jobs.pr_approver.plan.do[0].get(pr_approver).passed: job 'ci_concourse_test_pr' does not interact with resource 'pr_approver'
.
How can I restructure this to get the desired outcome, which is to have the pr_approver
job run after the ci_concourse_test_pr
successfully runs?
Here’s my pipeline
---
resource_types:
- name: pull-request
type: docker-image
source:
repository: teliaoss/github-pr-resource
resources:
- name: ci_concourse_test
type: pull-request
check_every: 168h
webhook_token: {SECRET}
source:
repository: {GITHUB_REPO}
access_token: {SECRET}
v3_endpoint: https://api.github.com/
v4_endpoint: https://api.github.com/graphql
- name: ci_concourse_test_main
type: git
source:
branch: main
uri: {GITHUB_REPO}
private_key: {SECRET}
- name: pr_approver
type: git
source:
branch: main
uri: {GITHUB_REPO}
private_key: {SECRET}
jobs:
- name: ci_concourse_test_pr
plan:
- get: ci_concourse_test
trigger: true
- put: ci_concourse_test
params:
path: ci_concourse_test
status: pending
- task: sample-test
config:
platform: linux
image_resource:
type: docker-image
source:
repository: {DOCKER_REPO}
tag: latest
inputs:
- name: ci_concourse_test
run:
path: python3
args: [ "ci_concourse_test/ci/test.py" ]
on_success:
put: ci_concourse_test
params:
path: ci_concourse_test
status: success
on_failure:
put: ci_concourse_test
params:
path: ci_concourse_test
status: failure
# Attempting to approve the PR
- name: pr_approver
plan:
- get: pr_approver
passed: [ci_concourse_test_pr]
trigger: true
- task: pr_approver
config:
platform: linux
image_resource:
type: docker-image
source:
repository: {GITHUB_REPO}
tag: latest
inputs:
- name: pr_approver
run:
path: python3
args: [ "github_interface/test.py" ]