|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 |
| -name: Check Vertex AI Mock Responses Version |
| 15 | +name: Check Vertex AI Responses |
16 | 16 |
|
17 | 17 | on: pull_request
|
18 | 18 |
|
19 | 19 | jobs:
|
20 |
| - check-responses-version: |
| 20 | + check-version: |
21 | 21 | runs-on: ubuntu-latest
|
22 | 22 | steps:
|
23 | 23 | - uses: actions/checkout@v4
|
24 | 24 | - name: Clone mock responses
|
25 | 25 | run: scripts/update_vertexai_responses.sh
|
26 | 26 | - name: Find cloned and latest versions
|
27 | 27 | run: |
|
28 |
| - echo "current_tag=$(git describe --tags)" >> $GITHUB_ENV |
29 |
| - # Fetch the latest tag matching the major version from the golden files repository |
30 |
| - echo "latest_tag=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' \ |
31 |
| - https://github.com/FirebaseExtended/vertexai-sdk-test-data.git | tail -n1 \ |
32 |
| - | awk -F'/' '{print $NF}')" >> $GITHUB_ENV |
| 28 | + CLONED=$(git describe --tags) |
| 29 | + LATEST=$(git tag --sort=v:refname | tail -n1) |
| 30 | + echo "cloned_tag=$CLONED" >> $GITHUB_ENV |
| 31 | + echo "latest_tag=$LATEST" >> $GITHUB_ENV |
33 | 32 | working-directory: packages/vertexai/test-utils/vertexai-sdk-test-data
|
34 | 33 | - name: Find comment from previous run if exists
|
35 | 34 | uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
|
|
38 | 37 | issue-number: ${{github.event.number}}
|
39 | 38 | body-includes: Vertex AI Mock Responses Check
|
40 | 39 | - name: Comment on PR if newer version is available
|
41 |
| - if: ${{env.current_tag != env.latest_tag && !steps.fc.outputs.comment-id}} |
| 40 | + if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}} |
42 | 41 | uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
|
43 | 42 | with:
|
44 | 43 | issue-number: ${{github.event.number}}
|
|
49 | 48 | [update_vertexai_responses.sh](https://github.com/firebase/firebase-js-sdk/blob/main/scripts/update_vertexai_responses.sh)
|
50 | 49 | should be updated to clone the latest version of the responses.
|
51 | 50 | - name: Delete comment when version gets updated
|
52 |
| - if: ${{env.current_tag == env.latest_tag && steps.fc.outputs.comment-id}} |
| 51 | + if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}} |
53 | 52 | uses: detomarco/delete-comment@850734dd44d8b15fef55b45252613b903ceb06f0
|
54 | 53 | with:
|
55 | 54 | comment-id: ${{ steps.fc.outputs.comment-id }}
|
0 commit comments