-
Notifications
You must be signed in to change notification settings - Fork 580
40 lines (37 loc) · 1.8 KB
/
check-vertexai-responses.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Check Vertex AI Responses
on: pull_request
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clone mock responses
run: firebase-vertexai/update_responses.sh
- name: Find cloned and latest versions
run: |
CLONED=$(git describe --tags)
LATEST=$(git tag --sort=v:refname | tail -n1)
echo "cloned_tag=$CLONED" >> $GITHUB_ENV
echo "latest_tag=$LATEST" >> $GITHUB_ENV
working-directory: firebase-vertexai/src/test/resources/vertexai-sdk-test-data
- name: Find comment from previous run if exists
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
id: fc
with:
issue-number: ${{github.event.number}}
body-includes: Vertex AI Mock Responses Check
- name: Comment on PR if newer version is available
if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}}
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
issue-number: ${{github.event.number}}
body: >
### Vertex AI Mock Responses Check :warning:
A newer major version of the mock responses for Vertex AI unit tests is available.
[update_responses.sh](https://github.com/firebase/firebase-android-sdk/blob/main/firebase-vertexai/update_responses.sh)
should be updated to clone the latest version of the responses: `${{env.latest_tag}}`
- name: Delete comment when version gets updated
if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}}
uses: detomarco/delete-comment@850734dd44d8b15fef55b45252613b903ceb06f0
with:
comment-id: ${{ steps.fc.outputs.comment-id }}