Skip to content

Commit

Permalink
Update jenkins action for sanitize
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 20, 2024
1 parent 2fde8e7 commit 7f54d14
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/rfs_pr_e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches-ignore:
- 'backport/**'
- 'dependabot/**'
pull_request_target:
types: [opened, synchronize, reopened]
pull_request:

env:
python-version: '3.11'
Expand All @@ -21,10 +20,19 @@ jobs:
- 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: |
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=https://github.com/$REPO_BASE.git,GIT_BRANCH=$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 7f54d14

Please sign in to comment.