-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 (devx): Create danger check ci script
Allow the possibility to run it locally. For now, we need to set a github token because the repo is private.
- Loading branch information
1 parent
c324e3c
commit 77ce8ef
Showing
2 changed files
with
28 additions
and
1 deletion.
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,27 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
is_running_on_github_actions() { | ||
[ -n "$CI" ] && [ -n "$GITHUB_ACTIONS" ] | ||
} | ||
|
||
run_danger_on_github_actions() { | ||
echo "Script is running within GitHub Actions workflow." | ||
pnpm danger ci --dangerfile danger/dangerfile.ts --failOnErrors | ||
} | ||
|
||
run_danger_on_local() { | ||
echo "Script is running locally." | ||
pnpm danger pr --dangerfile danger/dangerfile.ts https://github.com/LedgerHQ/device-sdk-ts/pull/${1} | ||
} | ||
|
||
if is_running_on_github_actions; then | ||
run_danger_on_github_actions | ||
else | ||
if [ -z "$1" ]; then | ||
echo "Argument PR number is missing" | ||
exit 1 | ||
fi | ||
run_danger_on_local "$1" | ||
fi | ||
|
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