From d3daf31f5ae03ef8dd15979a07ef78381b06c2ad Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sun, 14 Mar 2021 15:14:29 -0400 Subject: [PATCH 1/3] Update test.yml --- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f47c6f..87ff0ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token + - name: Run pg_dump uses: ./ with: @@ -43,3 +47,23 @@ jobs: if: steps.changed_backup.outputs.files_changed == 'true' run: | exit 1; + + - name: Commit changes to backup file. + if: failure() + run: | + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git add backups/backup.sql + git commit -m "Auto updated backup.sql." + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + if: steps.changed_backup.outputs.files_changed == 'true' + with: + base: "main" + title: "[Backup] Updated test database backup" + branch: "chore/update-test-db-backup" + commit-message: "Modified test database backup using latest migration changes." + body: "Updated test database backup." + reviewers: "jackton1" + token: ${{ secrets.PAT_TOKEN }} From b23789ab8400953092f1e504e8e30043cbbbe9a8 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sun, 14 Mar 2021 15:22:51 -0400 Subject: [PATCH 2/3] Update test.yml --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 87ff0ae..79c0aa9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,9 +27,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - with: - fetch-depth: 0 # otherwise, you will fail to push refs to dest repo - persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token - name: Run pg_dump uses: ./ From 7d6a26ec51ec5a255b88e2197ccedae5c962dfa3 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sun, 14 Mar 2021 15:24:04 -0400 Subject: [PATCH 3/3] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 79c0aa9..1ce138f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,7 +55,7 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v3 - if: steps.changed_backup.outputs.files_changed == 'true' + if: failure() with: base: "main" title: "[Backup] Updated test database backup"