Skip to content

Commit c43c61b

Browse files
committed
BUILD_URL_ARTIFACTS only for actions
1 parent 1586647 commit c43c61b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/yetus-general-check.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373
- name: Run Yetus Test Patch
7474
env:
7575
ARCHIVE_PATTERN_LIST: "TEST-*.xml,org.apache.h*.txt,*.dumpstream,*.dump"
76-
BUILD_URL_ARTIFACTS: "artifact/${{ github.run_number }}/output"
7776
DOCKERFILE: "${{ github.workspace }}/src/dev-support/docker/Dockerfile"
7877
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
7978
GITHUB_USER: ${{ github.actor }}

dev-support/jenkins_precommit_github_yetus.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ declare -i missing_env=0
3131
declare -a required_envs=(
3232
# these ENV variables define the required API with Jenkinsfile_GitHub
3333
"ARCHIVE_PATTERN_LIST"
34-
"BUILD_URL_ARTIFACTS"
3534
"DOCKERFILE"
3635
"GITHUB_PASSWORD"
3736
"GITHUB_USER"
@@ -53,6 +52,12 @@ for required_env in "${required_envs[@]}"; do
5352
fi
5453
done
5554

55+
# BUILD_URL_ARTIFACTS is required for Jenkins but optional for GitHub Actions
56+
if [[ "${GITHUB_ACTIONS}" != "true" ]] && [[ -z "${BUILD_URL_ARTIFACTS}" ]]; then
57+
echo "[ERROR] Required environment variable 'BUILD_URL_ARTIFACTS' is not set."
58+
missing_env=${missing_env}+1
59+
fi
60+
5661
if [ ${missing_env} -gt 0 ]; then
5762
echo "[ERROR] Please set the required environment variables before invoking. If this error is " \
5863
"on Jenkins, then please file a JIRA about the error."
@@ -103,7 +108,9 @@ YETUS_ARGS+=("--spotbugs-strict-precheck")
103108
# rsync these files back into the archive dir
104109
YETUS_ARGS+=("--archive-list=${ARCHIVE_PATTERN_LIST}")
105110
# URL for user-side presentation in reports and such to our artifacts
106-
YETUS_ARGS+=("--build-url-artifacts=${BUILD_URL_ARTIFACTS}")
111+
if [[ -n "${BUILD_URL_ARTIFACTS}" ]]; then
112+
YETUS_ARGS+=("--build-url-artifacts=${BUILD_URL_ARTIFACTS}")
113+
fi
107114
# plugins to enable
108115
YETUS_ARGS+=("--plugins=${PLUGINS},-findbugs")
109116
# run in docker mode and specifically point to our

0 commit comments

Comments
 (0)