Skip to content

Commit

Permalink
cleanup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ntruchsess committed Feb 6, 2024
1 parent acf8d1a commit bdc51d0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 57 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/pre-checks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################
# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation
# Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand Down Expand Up @@ -28,11 +28,6 @@ on:
types: [opened, synchronize, reopened]
workflow_dispatch:

env:
# variables needed for scripts/check_package_versions.sh
BASE_NAME: "${{ github.event.pull_request.base.ref }}"
HEAD_NAME: "${{ github.event.pull_request.head.ref }}"

jobs:

changes:
Expand Down Expand Up @@ -88,12 +83,13 @@ jobs:
- name: Check Package Versions
shell: bash
run: |
script_output=$(./scripts/check_package_versions.sh)
script_output=$(./scripts/nuget_version_check.sh origin/${{ github.event.pull_request.base.ref }})
if [ -z "$script_output" ]; then
echo "Expected version updates were made"
else
echo "the following packages need a version update: $script_output"
echo "the following packages need a version update:"
echo "$script_output"
echo "Please see https://github.com/eclipse-tractusx/portal-backend/blob/main/src/framework/README.md for further information"
exit 1
fi
23 changes: 0 additions & 23 deletions scripts/check_package_versions.sh

This file was deleted.

22 changes: 0 additions & 22 deletions scripts/check_package_versions_local.sh

This file was deleted.

7 changes: 4 additions & 3 deletions scripts/nuget_version_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# Get branch names
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <branchRange>"
echo "Usage: $0 <baseBranch|branchRange>"
exit 1
fi

Expand All @@ -30,18 +30,19 @@ branchRange="$1"

# Initialize a global arrays to store data
version_update_needed=()
first_version=""
unmatching_package=()

check_version_update(){
local project="$1"
local props_file=$project"Directory.Build.props"

# check if the code (.cs) unchanged
if ! git diff --name-only $branchRange -- "$project" | grep -qE '\.cs$' ||
# check if build.props file has been deleted
! [ -z $(git diff --name-only --diff-filter=D $branchRange -- "$props_file") ]; then
return
fi

# check if build.props file is unchanged
if [ -z $(git diff --name-only $branchRange -- "$props_file") ]; then
version_update_needed+=($project)
return
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_framework_versions.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################
# Copyright (c) 2024Contributors to the Eclipse Foundation
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand Down

0 comments on commit bdc51d0

Please sign in to comment.