File tree Expand file tree Collapse file tree 4 files changed +63
-1
lines changed
Expand file tree Collapse file tree 4 files changed +63
-1
lines changed Original file line number Diff line number Diff line change 11name : run codefresh pipeline
22on : push
33jobs :
4+
5+ clone :
6+ runs-on : ubuntu-18.04
7+ steps :
8+ - name : ' clone'
9+ - uses : actions/checkout@master
10+ env :
11+ PIPELINE_NAME : ' codefresh-pipeline'
12+ TRIGGER_NAME : ' codefresh-trigger'
13+ CF_API_KEY : ${{ secrets.GITHUB_TOKEN }}
14+ id : run-pipeline
15+
16+
417 build :
518 runs-on : ubuntu-18.04
619 steps :
720 - name : ' run pipeline'
8- uses : codefresh-io /codefresh-pip-runner- action@master
21+ uses : . /codefresh-action
922 env :
1023 PIPELINE_NAME : ' codefresh-pipeline'
1124 TRIGGER_NAME : ' codefresh-trigger'
Original file line number Diff line number Diff line change 1+ FROM codefresh/cli
2+
3+ LABEL "com.github.actions.name" ="codefresh-pipeline-runner"
4+ LABEL "com.github.actions.description" ="allows to run custom codefresh pipelines"
5+ LABEL "com.github.actions.icon" ="play-circle"
6+ LABEL "com.github.actions.color" ="green"
7+
8+ LABEL "repository" ="https://github.com/codefresh-io/codefresh-pipeline-runner"
9+ LABEL "homepage" ="https://github.com/codefresh-io/codefresh-pipeline-runner"
10+ LABEL "maintainer" ="<denys@codefresh.io>"
11+
12+ ADD runner-entrypoint.sh /runner-entrypoint.sh
13+
14+ ENTRYPOINT ["/runner-entrypoint.sh" ]
Original file line number Diff line number Diff line change 1+ name : ' Codefresh pipeline runner'
2+ description : ' Github action that runs codefresh pipeline'
3+ author : ' codefresh'
4+ branding :
5+ icon : ' arrow-right-circle'
6+ color : ' green'
7+ runs :
8+ using : ' docker'
9+ image : ' Dockerfile'
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # parse branch
4+ if [ -f $GITHUB_EVENT_PATH ]; then
5+ # in case of push event
6+ BRANCH=$( cat $GITHUB_EVENT_PATH | jq -r .ref | awk -F ' /' ' {print $3}' )
7+
8+ if [ -z " $BRANCH " ]
9+ then
10+ # in case of pullresuest event
11+ BRANCH=$( cat $GITHUB_EVENT_PATH | jq -r head.ref)
12+ fi
13+ else
14+ echo " Required file on path 'GITHUB_EVENT_PATH' not exists"
15+ fi
16+
17+ codefresh auth create-context context --api-key $CF_API_KEY
18+ codefresh auth use-contex context
19+
20+
21+ if [ -n " $TRIGGER_NAME " ]
22+ then
23+ codefresh run $PIPELINE_NAME --trigger=$TRIGGER_NAME --branch=$BRANCH
24+ else
25+ codefresh run $PIPELINE_NAME --branch=$BRANCH
26+ fi
You can’t perform that action at this time.
0 commit comments