-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from VincentHardouin/fix-shellcheck-error
- Loading branch information
Showing
6 changed files
with
84 additions
and
22 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,43 @@ | ||
name: Push | ||
|
||
on: push | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
name: Shellcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Run ShellCheck | ||
uses: ludeeus/action-shellcheck@master | ||
|
||
commitlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Lint Commit | ||
uses: wagoid/commitlint-github-action@v3 | ||
|
||
release: | ||
name: Publish new release | ||
needs: [lint, commitlint] | ||
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: npx semantic-release |
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,16 @@ | ||
{ | ||
"branches": [ | ||
"main" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"successComment": false, | ||
"releasedLabels": false | ||
} | ||
] | ||
] | ||
} |
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 |
---|---|---|
|
@@ -4,14 +4,14 @@ function stub_npm_test() { | |
replacement_text='"test": "exit 0"' | ||
file="$PWD/package.json" | ||
test_line=8 | ||
sed -i.bak "${test_line}s/.*/${replacement_text}/" $file && rm $file.bak | ||
sed -i.bak "${test_line}s/.*/${replacement_text}/" "$file" && rm "$file".bak | ||
} | ||
|
||
function restore_npm_test() { | ||
replacement_text=' "test": "exit 1"' | ||
file="$PWD/package.json" | ||
test_line=8 | ||
sed -i.bak "${test_line}s/.*/${replacement_text}/" $file && rm $file.bak | ||
sed -i.bak "${test_line}s/.*/${replacement_text}/" "$file" && rm "$file".bak | ||
} | ||
|
||
function remove_created_commit() { | ||
|
@@ -24,8 +24,8 @@ current_dir=$PWD | |
directory_under_test='./npm-directory' | ||
expected_output="Package Old New | ||
-------------------------------------- | ||
lodash 4.17.19 4.17.20" | ||
expected_commit_message="Bump lodash from 4.17.19 to 4.17.20" | ||
lodash 4.17.19 4.17.21" | ||
expected_commit_message="Bump lodash from 4.17.19 to 4.17.21" | ||
|
||
cd $directory_under_test || exit | ||
{ npm install --quiet [email protected] &> /dev/null; } 2>&1 | ||
|
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 |
---|---|---|
|
@@ -4,14 +4,14 @@ function stub_npm_test() { | |
replacement_text='"test": "exit 0"' | ||
file="$PWD/package.json" | ||
test_line=8 | ||
sed -i.bak "${test_line}s/.*/${replacement_text}/" $file && rm $file.bak | ||
sed -i.bak "${test_line}s/.*/${replacement_text}/" "$file" && rm "$file".bak | ||
} | ||
|
||
function restore_npm_test() { | ||
replacement_text=' "test": "exit 1"' | ||
file="$PWD/package.json" | ||
test_line=8 | ||
sed -i.bak "${test_line}s/.*/${replacement_text}/" $file && rm $file.bak | ||
sed -i.bak "${test_line}s/.*/${replacement_text}/" "$file" && rm "$file".bak | ||
} | ||
|
||
function remove_created_commit() { | ||
|
@@ -24,8 +24,8 @@ current_dir=$PWD | |
directory_under_test='./npm-directory' | ||
expected_output="Package|Old|New | ||
-|-|- | ||
lodash|4.17.19|4.17.20" | ||
expected_commit_message="Bump lodash from 4.17.19 to 4.17.20" | ||
lodash|4.17.19|4.17.21" | ||
expected_commit_message="Bump lodash from 4.17.19 to 4.17.21" | ||
|
||
cd $directory_under_test || exit | ||
{ npm install --quiet [email protected] &> /dev/null; } 2>&1 | ||
|
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
while IFS= read -r -d '' file; do | ||
find ./* -maxdepth 0 -type f -name "*.sh" -not -path "./runner.sh" -print0 | while IFS= read -r -d '' file; do | ||
bash "$file" || echo "$file" exit 1 | ||
done < <(find ./* -maxdepth 0 -type f -name "*.sh" -not -path "./runner.sh" -print0) | ||
done | ||
|