From ffd6cc571bd49830181c43fd3f59a8f2789dccd9 Mon Sep 17 00:00:00 2001 From: John Craft Date: Tue, 24 Oct 2023 07:00:09 -0700 Subject: [PATCH] Only run on new migrations --- .github/workflows/test-migration.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-migration.yml b/.github/workflows/test-migration.yml index 149d0ef..ad6a41a 100644 --- a/.github/workflows/test-migration.yml +++ b/.github/workflows/test-migration.yml @@ -2,8 +2,8 @@ name: Standup Database and Test Migration on: pull_request: branches: [ main ] - # paths: - # - 'users-api/src/migrations/**' + paths: + - 'users-api/src/migrations/**' jobs: check-migrations: @@ -70,3 +70,15 @@ jobs: - name: Cleanup run: docker stop $DB_HOST + + - name: Post a comment to PR + run: | + PR_COMMENT="This PR contains database migrations." + + # Post the comment to the PR + curl \ + -X POST \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \ + -d "{\"body\":\"$PR_COMMENT\"}"