Skip to content

Commit

Permalink
action: add pipeline and job_id outputs
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
  • Loading branch information
aluzzardi committed Sep 11, 2019
1 parent 823a142 commit 3f4d4a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ inputs:
description: "Whether or not to comment on the PR"
required: false
default: "true"
outputs:
pipeline:
description: The name of the pipeline
job_id:
description: The Job ID
runs:
using: "docker"
image: Dockerfile
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ PR_NUMBER="$(echo $PR_DATA | jq -r .number)"
PIPELINE=$(echo "${INPUT_PIPELINE}" | sed -e "s=\${PR_NUMBER}=$PR_NUMBER=g")
INPUTS=$(echo "${INPUT_INPUTS}" | sed -e "s=\${PR_NUMBER}=$PR_NUMBER=g")

echo ::set-output name=pipeline::$PIPELINE

# Set up auth
export GITHUB_TOKEN="${INPUT_REPO_TOKEN}"
export BL_API_KEY="${INPUT_API_KEY}"
Expand All @@ -31,6 +33,7 @@ SUCCESS=${PIPESTATUS[0]}

# Retrieve the job and wait for the pipeline to complete
JOB_ID=$(cat /tmp/output | sed -n -e 's/^success Submitted job \(.*\) to pipeline.*$/\1/p')
echo ::set-output name=job_id::$JOB_ID
bl line status -f "$PIPELINE" "$JOB_ID"

# If we're not in a pull request or commenting is disabled, stop here
Expand Down

0 comments on commit 3f4d4a1

Please sign in to comment.