Skip to content

Commit

Permalink
Update arg passing
Browse files Browse the repository at this point in the history
Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
  • Loading branch information
lewijacn committed Sep 18, 2024
1 parent 1959afd commit 5051f56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 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:
runs:
using: "docker"
image: "Dockerfile"
env:
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
PR_REPO: "https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git"
PUSH_BRANCH: "${{ github.ref_name }}"
PUSH_REPO: "https://github.com/${{ github.repository }}.git"

branding:
icon: 'check-circle'
Expand Down
18 changes: 9 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
printenv

if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
branch_name="${{ github.event.pull_request.head.ref }}"
pr_repo_url="https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git"
branch_name="${PR_BRANCH}"
pr_repo_url="${PR_REPO}"
else
branch_name="${{ github.ref_name }}"
pr_repo_url="https://github.com/${{ github.repository }}.git"
branch_name="${PUSH_BRANCH}"
pr_repo_url="${PUSH_REPO}"
fi
echo "Running jenkins test on repo: $pr_repo_url and branch: $branch_name"
pipenv run python3 default_webhook_trigger.py \
--jenkins_url="${{ INPUT_JENKINS_URL }}" \
--pipeline_token="${{ INPUT_API_TOKEN }}" \
--job_name="${{ INPUT_JOB_NAME }}" \
--job_params="${{ INPUT_JOB_PARAMS }}" \
--job_timeout_minutes="${{ INPUT_JOB_TIMEOUT_MINUTES }}"
--jenkins_url="${INPUT_JENKINS_URL}" \
--pipeline_token="${INPUT_API_TOKEN}" \
--job_name="${INPUT_JOB_NAME }" \
--job_params="${INPUT_JOB_PARAMS}" \
--job_timeout_minutes="${INPUT_JOB_TIMEOUT_MINUTES}"

0 comments on commit 5051f56

Please sign in to comment.