Skip to content

Commit bff33e0

Browse files
Merge pull request #2 from codefresh-io/add_test_action
Add test action
2 parents 4abe309 + 11af7a6 commit bff33e0

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.DS_Store

0 Bytes
Binary file not shown.

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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"]

runner-entrypoint.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
# parse branch
4+
# in case of push event
5+
BRANCH=$(cat $GITHUB_EVENT_PATH | jq -r .ref | awk -F '/' '{print $3}')
6+
7+
if [-z "$BRANCH"]
8+
then
9+
# in case of pullresuest event
10+
BRANCH=$(cat $GITHUB_EVENT_PATH | jq -r head.ref)
11+
fi
12+
13+
codefresh auth create-context mycontext --api-key $CF_API_KEY
14+
codefresh auth use-contex mycontext
15+
16+
codefresh run $PIPELINE_NAME --trigger=$TRIGGER_NAME --sha=$GITHUB_SHA --branch=$BRANCH

0 commit comments

Comments
 (0)