From 86a9028f1a38302e6b9c005e3e52d506e9c5ca6b Mon Sep 17 00:00:00 2001 From: shivaraj-bh Date: Tue, 28 May 2024 14:58:06 +0530 Subject: [PATCH] ci: enable auto-raise and merge PRs on remaining flakes After the success observed in https://github.com/juspay/services-flake/pull/201 --- .../update-flake-lock-ex-share-northwind.yaml | 18 +++++++++++++++++ .../update-flake-lock-ex-share-pgweb.yaml | 18 +++++++++++++++++ .github/workflows/update-flake-lock-test.yaml | 20 ++++++++++++++++++- 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-flake-lock-ex-share-northwind.yaml b/.github/workflows/update-flake-lock-ex-share-northwind.yaml index b4124de8..1e056e0e 100644 --- a/.github/workflows/update-flake-lock-ex-share-northwind.yaml +++ b/.github/workflows/update-flake-lock-ex-share-northwind.yaml @@ -8,16 +8,34 @@ jobs: example-lock: runs-on: ubuntu-latest steps: + - name: Generate Github App Token + uses: navikt/github-app-token-generator@v1 + id: github-app-token + with: + app-id: ${{ vars.NIXOS_ASIA_APP_ID }} + private-key: ${{ secrets.NIXOS_ASIA_PRIVATE_KEY }} - name: Checkout repository uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - name: Update flake.lock uses: DeterminateSystems/update-flake-lock@main + id: update-flake-lock with: commit-msg: "chore(example): Update share-services/northwind/flake.lock" pr-title: "Update example/share-services/northwind/flake.lock" + pr-body: | + Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action. + + ``` + {{ env.GIT_COMMIT_MESSAGE }} + ``` pr-labels: | automated path-to-flake-dir: 'example/share-services/northwind' branch: "update_flake_lock_ex_share_northwind" + token: ${{ steps.github-app-token.outputs.token }} + - run: "gh pr merge --auto --rebase ${{ steps.update-flake-lock.outputs.pull-request-number }}" + env: + GH_TOKEN: ${{ github.token }} + diff --git a/.github/workflows/update-flake-lock-ex-share-pgweb.yaml b/.github/workflows/update-flake-lock-ex-share-pgweb.yaml index 32dec2ac..6e22fbee 100644 --- a/.github/workflows/update-flake-lock-ex-share-pgweb.yaml +++ b/.github/workflows/update-flake-lock-ex-share-pgweb.yaml @@ -8,16 +8,34 @@ jobs: example-lock: runs-on: ubuntu-latest steps: + - name: Generate Github App Token + uses: navikt/github-app-token-generator@v1 + id: github-app-token + with: + app-id: ${{ vars.NIXOS_ASIA_APP_ID }} + private-key: ${{ secrets.NIXOS_ASIA_PRIVATE_KEY }} - name: Checkout repository uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - name: Update flake.lock uses: DeterminateSystems/update-flake-lock@main + id: update-flake-lock with: commit-msg: "chore(example): Update share-services/pgweb/flake.lock" pr-title: "Update example/share-services/pgweb/flake.lock" + pr-body: | + Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action. + + ``` + {{ env.GIT_COMMIT_MESSAGE }} + ``` pr-labels: | automated path-to-flake-dir: 'example/share-services/pgweb' branch: "update_flake_lock_ex_share_pgweb" + token: ${{ steps.github-app-token.outputs.token }} + - run: "gh pr merge --auto --rebase ${{ steps.update-flake-lock.outputs.pull-request-number }}" + env: + GH_TOKEN: ${{ github.token }} + diff --git a/.github/workflows/update-flake-lock-test.yaml b/.github/workflows/update-flake-lock-test.yaml index 5cbb2f80..ec81f459 100644 --- a/.github/workflows/update-flake-lock-test.yaml +++ b/.github/workflows/update-flake-lock-test.yaml @@ -8,16 +8,34 @@ jobs: example-lock: runs-on: ubuntu-latest steps: + - name: Generate Github App Token + uses: navikt/github-app-token-generator@v1 + id: github-app-token + with: + app-id: ${{ vars.NIXOS_ASIA_APP_ID }} + private-key: ${{ secrets.NIXOS_ASIA_PRIVATE_KEY }} - name: Checkout repository uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - name: Update flake.lock uses: DeterminateSystems/update-flake-lock@main + id: update-flake-lock with: commit-msg: "chore(test): Update flake.lock" pr-title: "Update test/flake.lock" + pr-body: | + Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action. + + ``` + {{ env.GIT_COMMIT_MESSAGE }} + ``` pr-labels: | automated path-to-flake-dir: 'test' - branch: "update_flake_lock_test" \ No newline at end of file + branch: "update_flake_lock_test" + token: ${{ steps.github-app-token.outputs.token }} + - run: "gh pr merge --auto --rebase ${{ steps.update-flake-lock.outputs.pull-request-number }}" + env: + GH_TOKEN: ${{ github.token }} +