Feat/edc-r25.09 #198
This file contains hidden or 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
############################################################### | |
# Copyright (c) 2025 Contributors to the Eclipse Foundation | |
# | |
# See the NOTICE file(s) distributed with this work for additional | |
# information regarding copyright ownership. | |
# | |
# This program and the accompanying materials are made available under the | |
# terms of the Apache License, Version 2.0 which is available at | |
# https://www.apache.org/licenses/LICENSE-2.0. | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
# License for the specific language governing permissions and limitations | |
# under the License. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
############################################################### | |
name: Check Frontend Dependencies | |
on: | |
push: | |
branches: [main] | |
paths: | |
- ichub-frontend/package-lock.json | |
- DEPENDENCIES_ICHUB-FRONTEND | |
- .github/workflows/dependencies-frontend.yaml | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- ichub-frontend/package-lock.json | |
- DEPENDENCIES_ICHUB-FRONTEND | |
- .github/workflows/dependencies-frontend.yaml | |
workflow_dispatch: | |
jobs: | |
check-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up JDK 17 | |
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Generate Dependencies file | |
run: | | |
curl -L --output ./dash.jar 'https://repo.eclipse.org/service/local/artifact/maven/redirect?r=dash-licenses&g=org.eclipse.dash&a=org.eclipse.dash.licenses&v=LATEST' | |
java -jar ./dash.jar ichub-frontend/package-lock.json -project automotive.tractusx -summary DEPENDENCIES_ICHUB-FRONTEND || true | |
- name: Check if dependencies were changed | |
id: dependencies-changed | |
run: | | |
changed=$(git diff DEPENDENCIES_ICHUB-FRONTEND) | |
if [[ -n "$changed" ]]; then | |
echo "dependencies changed" | |
echo "changed=true" >> $GITHUB_OUTPUT | |
else | |
echo "dependencies not changed" | |
echo "changed=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Check for restricted dependencies | |
run: | | |
restricted=$(grep ' restricted,' DEPENDENCIES_ICHUB-FRONTEND || true) | |
if [[ -n "$restricted" ]]; then | |
echo "The following dependencies are restricted: $restricted" | |
exit 1 | |
fi | |
if: steps.dependencies-changed.outputs.changed == 'true' | |
- name: Upload DEPENDENCIES_ICHUB-FRONTEND file | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
with: | |
path: DEPENDENCIES_ICHUB-FRONTEND | |
if: steps.dependencies-changed.outputs.changed == 'true' | |
- name: Signal need to update DEPENDENCIES_ICHUB | |
run: | | |
echo "Dependencies need to be updated (updated DEPENDENCIES_ICHUB file has been uploaded to workflow run)" | |
exit 1 | |
if: steps.dependencies-changed.outputs.changed == 'true' |