Skip to content

Commit 205ce7e

Browse files
authored
fix common.sh No such file or directory (#45)
1 parent b9a6a7c commit 205ce7e

File tree

4 files changed

+54
-21
lines changed

4 files changed

+54
-21
lines changed

breaking/entrypoint.sh

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
#!/bin/sh
22
set -e
33

4-
source $GITHUB_WORKSPACE/common/common.sh
4+
write_output () {
5+
local output="$1"
6+
if [ -n "$output_to_file" ]; then
7+
local file_output="$2"
8+
if [ -z "$file_output" ]; then
9+
file_output=$output
10+
fi
11+
echo "$file_output" >> "$output_to_file"
12+
fi
13+
# github-action limits output to 1MB
14+
# we count bytes because unicode has multibyte characters
15+
size=$(echo "$output" | wc -c)
16+
if [ "$size" -ge "1000000" ]; then
17+
echo "WARN: diff exceeds the 1MB limit, truncating output..." >&2
18+
output=$(echo "$output" | head -c 1000000)
19+
fi
20+
echo "$output" >>"$GITHUB_OUTPUT"
21+
}
522

623
readonly base="$1"
724
readonly revision="$2"

changelog/entrypoint.sh

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
#!/bin/sh
22
set -e
33

4-
source $GITHUB_WORKSPACE/common/common.sh
4+
write_output () {
5+
local output="$1"
6+
if [ -n "$output_to_file" ]; then
7+
local file_output="$2"
8+
if [ -z "$file_output" ]; then
9+
file_output=$output
10+
fi
11+
echo "$file_output" >> "$output_to_file"
12+
fi
13+
# github-action limits output to 1MB
14+
# we count bytes because unicode has multibyte characters
15+
size=$(echo "$output" | wc -c)
16+
if [ "$size" -ge "1000000" ]; then
17+
echo "WARN: diff exceeds the 1MB limit, truncating output..." >&2
18+
output=$(echo "$output" | head -c 1000000)
19+
fi
20+
echo "$output" >>"$GITHUB_OUTPUT"
21+
}
522

623
readonly base="$1"
724
readonly revision="$2"

common/common.sh

-18
This file was deleted.

diff/entrypoint.sh

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
#!/bin/sh
22
set -e
33

4-
source $GITHUB_WORKSPACE/common/common.sh
4+
write_output () {
5+
local output="$1"
6+
if [ -n "$output_to_file" ]; then
7+
local file_output="$2"
8+
if [ -z "$file_output" ]; then
9+
file_output=$output
10+
fi
11+
echo "$file_output" >> "$output_to_file"
12+
fi
13+
# github-action limits output to 1MB
14+
# we count bytes because unicode has multibyte characters
15+
size=$(echo "$output" | wc -c)
16+
if [ "$size" -ge "1000000" ]; then
17+
echo "WARN: diff exceeds the 1MB limit, truncating output..." >&2
18+
output=$(echo "$output" | head -c 1000000)
19+
fi
20+
echo "$output" >>"$GITHUB_OUTPUT"
21+
}
522

623
readonly base="$1"
724
readonly revision="$2"

0 commit comments

Comments
 (0)