forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run compatibility check based on PR base branch (opensearch-project#9374
) Signed-off-by: Sayali Gaikawad <[email protected]>
- Loading branch information
1 parent
94c212b
commit 1401223
Showing
1 changed file
with
21 additions
and
9 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 |
---|---|---|
|
@@ -5,11 +5,15 @@ on: | |
pull_request_target | ||
|
||
jobs: | ||
build: | ||
check-compatibility: | ||
if: github.repository == 'opensearch-project/OpenSearch' | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Run compatibility task | ||
run: ./gradlew checkCompatibility -i | tee $HOME/gradlew-check.out | ||
|
@@ -22,17 +26,25 @@ jobs: | |
echo "### Skipped components" >> "${{ github.workspace }}/results.txt" && grep -e 'Skipped component' $HOME/gradlew-check.out | sed -e 's/Skipped component: \[\(.*\)\]/- \1/' >> "${{ github.workspace }}/results.txt" | ||
echo "### Compatible components" >> "${{ github.workspace }}/results.txt" && grep -e 'Compatible component' $HOME/gradlew-check.out | sed -e 's/Compatible component: \[\(.*\)\]/- \1/' >> "${{ github.workspace }}/results.txt" | ||
- name: GitHub App token | ||
id: github_app_token | ||
uses: tibdex/[email protected] | ||
- name: Upload results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: results.txt | ||
path: ${{ github.workspace }}/results.txt | ||
|
||
add-comment: | ||
needs: [check-compatibility] | ||
permissions: | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download results | ||
uses: actions/download-artifact@v3 | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
installation_id: 22958780 | ||
name: results.txt | ||
|
||
- name: Add comment on the PR | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
token: ${{ steps.github_app_token.outputs.token }} | ||
issue-number: ${{ github.event.number }} | ||
body-path: "${{ github.workspace }}/results.txt" | ||
body-path: results.txt |