forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Prudhvi Godithi <[email protected]>
- Loading branch information
1 parent
6da488d
commit 2592854
Showing
2 changed files
with
75 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Gradle Check (Jenkins) | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'backport/**' | ||
- 'create-pull-request/**' | ||
- 'dependabot/**' | ||
pull_request_target: | ||
types: [opened, synchronize, reopened] | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
gradle-check: | ||
if: github.repository == 'prudhvigodithi/opensearch-build' | ||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
pull-requests: write # to create or update comment (peter-evans/create-or-update-comment) | ||
issues: write # To create an issue if check fails on push. | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 130 | ||
steps: | ||
- name: Checkout OpenSearch repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Setup environment variables (PR) | ||
if: github.event_name == 'pull_request_target' | ||
run: | | ||
echo "event_name=pull_request_target" >> $GITHUB_ENV | ||
echo "branch_name=$(jq --raw-output .pull_request.base.ref $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
echo "pr_from_sha=$(jq --raw-output .pull_request.head.sha $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
echo "pr_from_clone_url=$(jq --raw-output .pull_request.head.repo.clone_url $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
echo "pr_to_clone_url=$(jq --raw-output .pull_request.base.repo.clone_url $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
echo "pr_title=$(jq --raw-output .pull_request.title $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
echo "pr_number=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
echo "pr_owner=$(jq --raw-output .pull_request.user.login $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
echo "pr_or_commit_description=$(jq --ascii-output .pull_request.body $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
cat $GITHUB_ENV | ||
- name: Setup environment variables (Push) | ||
if: github.event_name == 'push' | ||
run: | | ||
repo_url="https://github.com/opensearch-project/OpenSearch" | ||
ref_id=$(git rev-parse HEAD) | ||
branch_name=$(git rev-parse --abbrev-ref HEAD) | ||
echo "branch_name=$branch_name" >> $GITHUB_ENV | ||
echo "event_name=push" >> $GITHUB_ENV | ||
echo "pr_from_sha=$ref_id" >> $GITHUB_ENV | ||
echo "pr_from_clone_url=$repo_url" >> $GITHUB_ENV | ||
echo "pr_to_clone_url=$repo_url" >> $GITHUB_ENV | ||
echo "pr_title=Push trigger $branch_name $ref_id $repo_url" >> $GITHUB_ENV | ||
echo "pr_owner=$(jq --raw-output '.commits[0].author.username' $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
echo "pr_number=$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
echo "pr_or_commit_description=$(jq --ascii-output .head_commit.message $GITHUB_EVENT_PATH)" >> $GITHUB_ENV | ||
cat $GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters