-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0196f5
commit 9b3b0d1
Showing
2 changed files
with
55 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Run danger | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
# Note: | ||
# Maybe can use linux image | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache bundler | ||
uses: actions/cache@v1 | ||
with: | ||
path: vendor/bundle | ||
key: bundler-${{ hashFiles('Gemfile.lock') }} | ||
restore-keys: | | ||
bundler-${{ hashFiles('Gemfile.lock') }} | ||
- name: Setup | ||
run: | | ||
bundle | ||
# Note: | ||
# Run only PR in own repository. | ||
# Because can't push to forked repository. | ||
- name: Run rubocop --auto-correct and push | ||
if: contains(github.event.pull_request.head.repo.clone_url, github.repository) | ||
run: | | ||
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | ||
git config --global user.name 'Yusuke Hosonuma' | ||
git config --global user.email '[email protected]' | ||
git checkout -b ${{ github.head_ref }} origin/${{ github.head_ref }} | ||
bundle exec rubocop --auto-correct && true | ||
git add -u | ||
git diff-index --quiet HEAD -- || git commit -m '[ci skip] $ rubocop --auto-correct' | ||
git push | ||
# Note: | ||
# Run only PR in own repository. | ||
# Because can't comment to PR from danger. (Maybe you can... ?) | ||
- name: Run danger | ||
if: contains(github.event.pull_request.head.repo.clone_url, github.repository) | ||
run: | | ||
bundle exec danger | ||
env: | ||
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: Run danger | ||
name: Test | ||
|
||
on: [pull_request] | ||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
@@ -24,28 +24,9 @@ jobs: | |
run: | | ||
bundle | ||
# Note: | ||
# Run only PR in own repository. | ||
# Because can't push to forked repository. | ||
- name: Run rubocop --auto-correct and push | ||
if: contains(github.event.pull_request.head.repo.clone_url, github.repository) | ||
run: | | ||
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | ||
git config --global user.name 'Yusuke Hosonuma' | ||
git config --global user.email '[email protected]' | ||
git checkout -b ${{ github.head_ref }} origin/${{ github.head_ref }} | ||
bundle exec rubocop --auto-correct && true | ||
git add -u | ||
git diff-index --quiet HEAD -- || git commit -m '[ci skip] $ rubocop --auto-correct' | ||
git push | ||
# Note: | ||
# Run only PR in own repository. | ||
# Because can't comment to PR from danger. (Maybe you can... ?) | ||
- name: Run danger | ||
if: contains(github.event.pull_request.head.repo.clone_url, github.repository) | ||
- name: Run test | ||
run: | | ||
bundle exec danger | ||
rake test | ||
env: | ||
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} |