From 91ebf4b2691ba3ea54c71ac6cdc1393fdfb6eb63 Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Fri, 1 Jan 2021 22:52:22 +0000 Subject: [PATCH 01/13] ruby 2.7 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 572d82b..a581581 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.6-alpine +FROM ruby:2.7-alpine RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ apk add --no-cache \ From fd37a51d868ecbfd9fe15d9ea505f285aa37a9bc Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Fri, 1 Jan 2021 23:12:49 +0000 Subject: [PATCH 02/13] Update action.yml --- action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/action.yml b/action.yml index 67626b7..be1d900 100644 --- a/action.yml +++ b/action.yml @@ -26,3 +26,9 @@ runs: GITHUB_TOKEN: ${{ inputs.github_token }} GIT_USER_NAME: ${{ inputs.git_user_name }} GIT_EMAIL: ${{ inputs.git_email }} +# uses: woodcock3/jekyll4-deploy-gh-pages@master + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} + # GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} + From abcd73b0836cb322dd497e6131316a8c2995e104 Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Fri, 1 Jan 2021 23:29:15 +0000 Subject: [PATCH 03/13] Update action.yml --- action.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/action.yml b/action.yml index be1d900..67626b7 100644 --- a/action.yml +++ b/action.yml @@ -26,9 +26,3 @@ runs: GITHUB_TOKEN: ${{ inputs.github_token }} GIT_USER_NAME: ${{ inputs.git_user_name }} GIT_EMAIL: ${{ inputs.git_email }} -# uses: woodcock3/jekyll4-deploy-gh-pages@master - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} - # GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} - From 2baf591c10ce9fb5541942010ea416f439ad7ef0 Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Fri, 1 Jan 2021 23:53:57 +0000 Subject: [PATCH 04/13] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a581581..572d82b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7-alpine +FROM ruby:2.6-alpine RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ apk add --no-cache \ From 6e1c6a5344d7b8689fe39562c9e139e41951a881 Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Sat, 2 Jan 2021 01:30:49 +0000 Subject: [PATCH 05/13] corrected bundler version --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 8385f98..5c3b15e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,8 +24,8 @@ git checkout -b ${BRANCH_NAME} export PATH="/usr/local/bundle/bin:$PATH" -if [[ -n "$INPUT_BUNDLER_VERSION" ]]; then - gem install bundler -v "$INPUT_BUNDLER_VERSION" +if [[ -n "$BUNDLER_VERSION" ]]; then + gem install bundler -v "$BUNDLER_VERSION" else gem install bundler fi From 00f413958d22b3804fbd6dcdbb74ea6153a4bf8c Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Sat, 2 Jan 2021 01:39:18 +0000 Subject: [PATCH 06/13] alpine spelling error --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f3b2cf..afbc541 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This Github Action is that send pull request on bundle update. To draw bundle update diff table, I'd like use [bundler-diff](https://github.com/sinsoku/bundler-diff), Thank you. -This Github Action is running on **[ruby2.6-alipne](https://github.com/docker-library/ruby/blob/5c9e21cbf79b7f36d505555c9ecd62cf0f7e07f8/2.6/alpine3.10/Dockerfile)**. +This Github Action is running on **[ruby2.6-alpine](https://github.com/docker-library/ruby/blob/5c9e21cbf79b7f36d505555c9ecd62cf0f7e07f8/2.6/alpine3.10/Dockerfile)**. ## Usage ※ Without Gemfile and Gemfile.lock, this workflow is failure. From 75a7b2884308355648a9c5acc754027bd9e6b6df Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Sat, 2 Jan 2021 01:57:36 +0000 Subject: [PATCH 07/13] Alternative usage example also corrected ## optional as // optional causes failed run --- README.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index afbc541..9ca4111 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,35 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} git_user_name: example_name git_email: test@example.com - reviewers: supermanner,hoge,fuga // optional - bundler_version: 2.0.1 // optional + reviewers: supermanner,hoge,fuga ## optional + bundler_version: 2.0.1 ## optional +``` +### Or to update Gemfile.lock when Gemfile changed + +``` +name: pull request on bundle update +on: + push: + paths: + - 'Gemfile' + + +jobs: + bundle-update: + name: bundle update + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + with: + fetch-depth: 1 + - name: pull request on bundle update + uses: woodcock3/pull-request-on-bundle-update@v1.0.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + git_user_name: ${{ secrets.HUB_USER }} + git_email: ${{ secrets.HUB_EMAIL }} + bundler_version: 2.1.4 ## optional ``` ## Demo From 84400eb5b5bd26288be0af89d3b3ead6ab0f26cb Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Mon, 11 Apr 2022 17:03:16 +0100 Subject: [PATCH 08/13] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 572d82b..099b373 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.6-alpine +FROM ruby:2.7 RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ apk add --no-cache \ From 04e523360f7cc4d3b1c92b63007a3a11dbdbcf68 Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Sat, 30 Apr 2022 12:46:30 +0100 Subject: [PATCH 09/13] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 099b373..572d82b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7 +FROM ruby:2.6-alpine RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && \ apk add --no-cache \ From d9ea0462be637c2ed5dfa406518fce6054e43f43 Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Wed, 23 Nov 2022 06:30:49 +0000 Subject: [PATCH 10/13] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5c3b15e..2f48a55 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,7 +17,7 @@ if [[ -z "$GIT_EMAIL" ]]; then exit 1 fi -git remote set-url origin "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" +git remote set-url origin "https://github.com/$GITHUB_REPOSITORY.git" git checkout master BRANCH_NAME="bundle_update/$(date "+%Y%m%d_%H%M%S")" git checkout -b ${BRANCH_NAME} From 34b740255cb22ebd0b802668d2dfc489e552a070 Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Wed, 23 Nov 2022 06:32:27 +0000 Subject: [PATCH 11/13] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2f48a55..bc37f2d 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -17,7 +17,7 @@ if [[ -z "$GIT_EMAIL" ]]; then exit 1 fi -git remote set-url origin "https://github.com/$GITHUB_REPOSITORY.git" +git remote set-url origin "https://github.com/$GIT_USER_NAME/$GITHUB_REPOSITORY.git" git checkout master BRANCH_NAME="bundle_update/$(date "+%Y%m%d_%H%M%S")" git checkout -b ${BRANCH_NAME} From eae40c37480835d827f5c3383769111060a97eb5 Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Wed, 23 Nov 2022 06:37:03 +0000 Subject: [PATCH 12/13] Update entrypoint.sh --- entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoint.sh b/entrypoint.sh index bc37f2d..5bf9845 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -46,6 +46,7 @@ export GITHUB_USER="$GITHUB_ACTOR" git config --global user.name $GIT_USER_NAME git config --global user.email $GIT_EMAIL +git config --global --add safe.directory /github/workspace hub add Gemfile Gemfile.lock hub commit -m "bundle update && bundle update --ruby" From 6838507454c2089e5882520e9892abf953c524f3 Mon Sep 17 00:00:00 2001 From: Paul <64870518+woodcock3@users.noreply.github.com> Date: Wed, 23 Nov 2022 06:40:42 +0000 Subject: [PATCH 13/13] Update entrypoint.sh --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5bf9845..0ae758d 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -44,9 +44,9 @@ fi export GITHUB_USER="$GITHUB_ACTOR" +git config --global --add safe.directory /github/workspace git config --global user.name $GIT_USER_NAME git config --global user.email $GIT_EMAIL -git config --global --add safe.directory /github/workspace hub add Gemfile Gemfile.lock hub commit -m "bundle update && bundle update --ruby"