Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
e8909be0
Commit
e8909be0
authored
Jul 13, 2022
by
Joshua Gutow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ops: Fix unbound variable in check_changed script
parent
0a86b91c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
funny-windows-hope.md
.changeset/funny-windows-hope.md
+8
-0
check-changed.sh
ops/docker/ci-builder/check-changed.sh
+7
-5
No files found.
.changeset/funny-windows-hope.md
0 → 100644
View file @
e8909be0
---
'
@eth-optimism/ci-builder'
:
minor
---
Fix unbound variable in check_changed script
This now uses -z to check if a variable is unbound instead of -n.
This should fix the error when the script is being ran on develop.
ops/docker/ci-builder/check-changed.sh
View file @
e8909be0
...
@@ -9,7 +9,13 @@
...
@@ -9,7 +9,13 @@
echoerr
()
{
echo
"
$@
"
1>&2
;
}
echoerr
()
{
echo
"
$@
"
1>&2
;
}
# Check if this is a CircleCI PR.
# Check if this is a CircleCI PR.
if
[[
-n
$CIRCLE_PULL_REQUEST
]]
;
then
if
[[
-z
${
CIRCLE_PULL_REQUEST
+x
}
]]
;
then
# CIRCLE_PULL_REQUEST is unbound here
# Non-PR builds always require a rebuild.
echoerr
"Not a PR build, requiring a total rebuild."
echo
"TRUE"
else
# CIRCLE_PULL_REQUEST is bound here
PACKAGE
=
$1
PACKAGE
=
$1
# Craft the URL to the GitHub API. The access token is optional for the monorepo since it's an open-source repo.
# Craft the URL to the GitHub API. The access token is optional for the monorepo since it's an open-source repo.
GITHUB_API_URL
=
"https://api.github.com/repos/ethereum-optimism/optimism/pulls/
${
CIRCLE_PULL_REQUEST
/https
:
\/\/github.com\/ethereum-optimism\/optimism\/pull\//
}
"
GITHUB_API_URL
=
"https://api.github.com/repos/ethereum-optimism/optimism/pulls/
${
CIRCLE_PULL_REQUEST
/https
:
\/\/github.com\/ethereum-optimism\/optimism\/pull\//
}
"
...
@@ -30,8 +36,4 @@ if [[ -n $CIRCLE_PULL_REQUEST ]]; then
...
@@ -30,8 +36,4 @@ if [[ -n $CIRCLE_PULL_REQUEST ]]; then
# Compare HEAD to the PR's base ref, stripping out the change percentages that come with git diff --dirstat.
# Compare HEAD to the PR's base ref, stripping out the change percentages that come with git diff --dirstat.
# Pass in the diff pattern to grep, and echo TRUE if there's a match. False otherwise.
# Pass in the diff pattern to grep, and echo TRUE if there's a match. False otherwise.
(
echo
"
$DIFF
"
|
sed
's/^[ 0-9.]\+% //g'
|
grep
-q
-E
"
$PACKAGE
"
&&
echo
"TRUE"
)
||
echo
"FALSE"
(
echo
"
$DIFF
"
|
sed
's/^[ 0-9.]\+% //g'
|
grep
-q
-E
"
$PACKAGE
"
&&
echo
"TRUE"
)
||
echo
"FALSE"
else
# Non-PR builds always require a rebuild.
echoerr
"Not a PR build, requiring a total rebuild."
echo
"TRUE"
fi
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment