Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ 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/$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}

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
Expand All @@ -44,6 +44,7 @@ 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

Expand Down