Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run compatibility check based on PR base branch #9374

Merged
merged 4 commits into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/check-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
peternied marked this conversation as resolved.
Show resolved Hide resolved

- name: Run compatibility task
run: ./gradlew checkCompatibility -i | tee $HOME/gradlew-check.out
Expand All @@ -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