From 6ea443dca5b954b8d5584e345fda1b99c9ba2fdd Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 14:42:23 +0200 Subject: [PATCH 01/12] Experiment with autobump deps PR workflow --- .../workflows/update-to-latest-easystats.yml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/update-to-latest-easystats.yml diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml new file mode 100644 index 000000000..2cc8d2228 --- /dev/null +++ b/.github/workflows/update-to-latest-easystats.yml @@ -0,0 +1,50 @@ +name: Create PR for DESCRIPTION change + +on: + push: + branches: + - [main, master] + +# Run on a schedule (once a month) +schedule: + - cron: "0 0 1 * *" + +jobs: + create_pr: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up R + uses: r-lib/actions/setup-r@v2 + + - name: Install dependencies + run: | + Rscript -e "install.packages('usethis')" + shell: bash + working-directory: ./ # Change this to the appropriate directory if necessary + + - name: Update DESCRIPTION file + run: | + Rscript -e "usethis::use_latest_dependencies()" + shell: bash + working-directory: ./ # Change this to the appropriate directory if necessary + + - name: Check for changes in DESCRIPTION + id: check_description + run: | + git diff --name-only + continue-on-error: true # Continue even if there are no changes + + - name: Create pull request + if: steps.check_description.outputs.stdout != '' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: update-description + title: "Update DESCRIPTION to use latest 'easystats' dependencies" + body: "Automatically updated the `DESCRIPTION` file." + labels: "auto-update" + base: main # Change this to the target branch for your pull request + branch-suffix: timestamp From e27f7c1d45d5fbf25b9c0948046299a2de8bc75c Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 14:44:14 +0200 Subject: [PATCH 02/12] Update update-to-latest-easystats.yml --- .github/workflows/update-to-latest-easystats.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index 2cc8d2228..b89c9a77e 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -2,8 +2,9 @@ name: Create PR for DESCRIPTION change on: push: - branches: - - [main, master] + branches: [main, master] + pull_request: + branches: [main, master] # Run on a schedule (once a month) schedule: From 750103ce636d7c13ccd528ef5b92b236d759934b Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 14:45:25 +0200 Subject: [PATCH 03/12] Update update-to-latest-easystats.yml --- .github/workflows/update-to-latest-easystats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index b89c9a77e..52b510f64 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -7,8 +7,8 @@ on: branches: [main, master] # Run on a schedule (once a month) -schedule: - - cron: "0 0 1 * *" +#schedule: +# - cron: "0 0 1 * *" jobs: create_pr: From 491915f47ee33f867f66915f009ebb7f51477f1b Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 14:52:33 +0200 Subject: [PATCH 04/12] Update update-to-latest-easystats.yml --- .../workflows/update-to-latest-easystats.yml | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index 52b510f64..dcc9fdc80 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -1,4 +1,4 @@ -name: Create PR for DESCRIPTION change +name: Create PR for DESCRIPTION change to use latest easystats dependencies on: push: @@ -7,8 +7,8 @@ on: branches: [main, master] # Run on a schedule (once a month) -#schedule: -# - cron: "0 0 1 * *" +# schedule: +# - cron: "0 0 1 * *" jobs: create_pr: @@ -20,17 +20,11 @@ jobs: - name: Set up R uses: r-lib/actions/setup-r@v2 - - name: Install dependencies - run: | - Rscript -e "install.packages('usethis')" - shell: bash - working-directory: ./ # Change this to the appropriate directory if necessary - - name: Update DESCRIPTION file run: | - Rscript -e "usethis::use_latest_dependencies()" - shell: bash - working-directory: ./ # Change this to the appropriate directory if necessary + install.packages('usethis') + usethis::use_latest_dependencies() + shell: Rscript {0} - name: Check for changes in DESCRIPTION id: check_description @@ -47,5 +41,5 @@ jobs: title: "Update DESCRIPTION to use latest 'easystats' dependencies" body: "Automatically updated the `DESCRIPTION` file." labels: "auto-update" - base: main # Change this to the target branch for your pull request + base: main branch-suffix: timestamp From 37629a55d67df82b7ae7ab8707fc650bf666b715 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 14:53:30 +0200 Subject: [PATCH 05/12] Update update-to-latest-easystats.yml --- .github/workflows/update-to-latest-easystats.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index dcc9fdc80..1a62d453c 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -22,7 +22,8 @@ jobs: - name: Update DESCRIPTION file run: | - install.packages('usethis') + install.packages('pak') + pak::pkg_install('usethis') usethis::use_latest_dependencies() shell: Rscript {0} From c5ed619db9826775232376fe82c77df91dc92c1b Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 14:57:23 +0200 Subject: [PATCH 06/12] Update update-to-latest-easystats.yml --- .github/workflows/update-to-latest-easystats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index 1a62d453c..d2271af84 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -1,4 +1,4 @@ -name: Create PR for DESCRIPTION change to use latest easystats dependencies +name: update-to-latest-easystats on: push: @@ -11,7 +11,7 @@ on: # - cron: "0 0 1 * *" jobs: - create_pr: + update-to-latest-easystats: runs-on: ubuntu-latest steps: - name: Checkout code @@ -22,7 +22,7 @@ jobs: - name: Update DESCRIPTION file run: | - install.packages('pak') + install.packages('pak', dependencies = TRUE) pak::pkg_install('usethis') usethis::use_latest_dependencies() shell: Rscript {0} From f7ed0940b87bdc0fc7385104c29920bb70a3ba38 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 15:10:39 +0200 Subject: [PATCH 07/12] Update update-to-latest-easystats.yml --- .github/workflows/update-to-latest-easystats.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index d2271af84..7a4072217 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -20,10 +20,14 @@ jobs: - name: Set up R uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + dependencies: "hard" + extra-packages: | + any::usethis + - name: Update DESCRIPTION file run: | - install.packages('pak', dependencies = TRUE) - pak::pkg_install('usethis') usethis::use_latest_dependencies() shell: Rscript {0} From df574bf5bacf9f6992f573d35796722eb8c1c7bb Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 15:26:58 +0200 Subject: [PATCH 08/12] Update update-to-latest-easystats.yml --- .github/workflows/update-to-latest-easystats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index 7a4072217..f79eda603 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -22,7 +22,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - dependencies: "hard" + dependencies: '"hard"' extra-packages: | any::usethis From 1db6575b92d191180798e7107bb896d3a70812e0 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 15:39:41 +0200 Subject: [PATCH 09/12] check git status --- .github/workflows/update-to-latest-easystats.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index f79eda603..37ec97dc9 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -34,6 +34,7 @@ jobs: - name: Check for changes in DESCRIPTION id: check_description run: | + git status git diff --name-only continue-on-error: true # Continue even if there are no changes From ff3ba62fcb48629a7a800ca6ae47f5e503a7786b Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 15:50:33 +0200 Subject: [PATCH 10/12] Update update-to-latest-easystats.yml --- .../workflows/update-to-latest-easystats.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index 37ec97dc9..f929c725c 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -27,6 +27,7 @@ jobs: any::usethis - name: Update DESCRIPTION file + id: update_description run: | usethis::use_latest_dependencies() shell: Rscript {0} @@ -35,17 +36,20 @@ jobs: id: check_description run: | git status - git diff --name-only + git add --all continue-on-error: true # Continue even if there are no changes - name: Create pull request - if: steps.check_description.outputs.stdout != '' + if: ${{ steps.update_description.outputs.changed }} uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} - branch: update-description - title: "Update DESCRIPTION to use latest 'easystats' dependencies" - body: "Automatically updated the `DESCRIPTION` file." - labels: "auto-update" - base: main + base: ${{ github.head_ref }} + branch: desc-${{ github.ref_name }}-${{ github.job }} branch-suffix: timestamp + delete-branch: true + title: "Update `DESCRIPTION` to use latest 'easystats' dependencies" + body: "Automatically updated the `DESCRIPTION` file using `usethis::use_latest_dependencies()`." + labels: "auto-update" + add-paths: | + DESCRIPTION From d1375241ddefc5fb3c0a45374e49a90d6235a10c Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 15:55:19 +0200 Subject: [PATCH 11/12] Update update-to-latest-easystats.yml --- .github/workflows/update-to-latest-easystats.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index f929c725c..dff0afbce 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -37,7 +37,6 @@ jobs: run: | git status git add --all - continue-on-error: true # Continue even if there are no changes - name: Create pull request if: ${{ steps.update_description.outputs.changed }} From cd65dd97597ace29098600ed8b6ed9ccefb1e444 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Wed, 27 Sep 2023 15:58:43 +0200 Subject: [PATCH 12/12] Update update-to-latest-easystats.yml --- .github/workflows/update-to-latest-easystats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-to-latest-easystats.yml b/.github/workflows/update-to-latest-easystats.yml index dff0afbce..90f6f3fc3 100644 --- a/.github/workflows/update-to-latest-easystats.yml +++ b/.github/workflows/update-to-latest-easystats.yml @@ -39,11 +39,11 @@ jobs: git add --all - name: Create pull request - if: ${{ steps.update_description.outputs.changed }} + #if: ${{ steps.update_description.outputs.changed }} uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} - base: ${{ github.head_ref }} + base: main branch: desc-${{ github.ref_name }}-${{ github.job }} branch-suffix: timestamp delete-branch: true