-
Notifications
You must be signed in to change notification settings - Fork 1
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
2ee8690
commit 3c867d1
Showing
9 changed files
with
101 additions
and
136 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
name: Danger CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
test: | ||
name: Danger CI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Install dependencies | ||
run: yarn add danger | ||
|
||
- name: Danger CI Check | ||
uses: danger/[email protected] | ||
env: | ||
CI: true | ||
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }} | ||
DANGER_GITHUB_API_TOKEN: ${{ secrets.GH_RELEASE_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
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,24 @@ | ||
name: Release | ||
on: | ||
workflow_run: | ||
workflows: | ||
- "Lint, Test & Build" | ||
types: | ||
- completed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Release | ||
run: npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_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 |
---|---|---|
|
@@ -11,7 +11,6 @@ on: | |
- "Deploy" | ||
- "Gitlab Sync" | ||
- "BitBucket Sync" | ||
- "CodeQL" | ||
types: | ||
- completed | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
{ | ||
"branches": ["main", {"name":"beta", "prerelease": true}], | ||
"tagFormat": "v${version}", | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -13,6 +13,6 @@ lint: | |
|
||
build: | ||
@echo "Building application" | ||
./gradlew build | ||
./gradlew build -x test | ||
|
||
all: install lint test |
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,26 @@ | ||
import { danger, warn, markdown } from 'danger'; | ||
|
||
// Setup | ||
const { pr } = danger.github; | ||
const modifiedFiles = danger.git.modified_files; | ||
const packageChanged = modifiedFiles.includes('package.json'); | ||
const lockfileChanged = modifiedFiles.includes('yarn.lock'); | ||
|
||
// Always ensure we assign someone, so that our Slackbot can do its work correctly | ||
if (pr.assignee === null) { | ||
fail('Please assign someone to merge this PR, and optionally include people who should review.'); | ||
} | ||
|
||
const bigPRThreshold = 600; | ||
if (pr.additions + pr.deletions > bigPRThreshold) { | ||
warn(`:exclamation: Big PR`); | ||
markdown( | ||
`>: Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.`, | ||
); | ||
} | ||
|
||
if (packageChanged && !lockfileChanged) { | ||
const message = 'Changes were made to package.json, but not to yarn.lock'; | ||
const idea = 'Perhaps you need to run `yarn install`?'; | ||
warn(`${message} - <i>${idea}</i>`); | ||
} |