Skip to content

Commit

Permalink
Remove Jenkins Action User Supplied Context Expressions (#988)
Browse files Browse the repository at this point in the history
* Rework jenkins github action to remove user supplied context expressions

Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
  • Loading branch information
lewijacn committed Sep 20, 2024
1 parent eaeb4c7 commit 4ad0443
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/rfs_pr_e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,22 @@ jobs:
rfs-e2e-aws-test:
runs-on: ubuntu-latest
steps:
- name: Determine Github repository and branch
id: determine-repo-vars
- env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }}
REPO_BASE: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
- name: Sanitize branch and repo names
id: sanitize-input
run: |
if [[ "${GITHUB_EVENT_NAME}" == "pull_request_target" ]]; then
branch_name="${{ github.event.pull_request.head.ref }}"
pr_repo_url="https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git"
else
branch_name="${{ github.ref_name }}"
pr_repo_url="https://github.com/${{ github.repository }}.git"
fi
echo "Running jenkins test on repo: $pr_repo_url and branch: $branch_name"
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
echo "pr_repo_url=$pr_repo_url" >> $GITHUB_OUTPUT
clean_branch_name = $(echo "$BRANCH_NAME" | tr -cd '[:alnum:]_-./')
clean_repo_base = $(echo "$REPO_BASE" | tr -cd '[:alnum:]_-./')
clean_repo_url = "https://github.com/$clean_repo_base.git"
echo "Running jenkins test on repo: $clean_repo_url and branch: $clean_branch_name"
echo "branch_name=$clean_branch_name" >> $GITHUB_OUTPUT
echo "pr_repo_url=$clean_repo_url" >> $GITHUB_OUTPUT
- name: Jenkins Job Trigger and Monitor
uses: lewijacn/jenkins-trigger@1.0.4
with:
jenkins_url: "https://migrations.ci.opensearch.org"
job_name: "rfs-default-e2e-test"
api_token: "${{ secrets.JENKINS_MIGRATIONS_GENERIC_WEBHOOK_TOKEN }}"
job_params: "GIT_REPO_URL=${{ steps.determine-repo-vars.outputs.pr_repo_url }},GIT_BRANCH=${{ steps.determine-repo-vars.outputs.branch_name }}"
job_params: "GIT_REPO_URL=${{ steps.sanitize-input.outputs.pr_repo_url }},GIT_BRANCH=${{ steps.sanitize-input.outputs.branch_name }}"

0 comments on commit 4ad0443

Please sign in to comment.