Merge pull request #1356 from eclipse-tractusx/chore/update-openapi-spec #356
This file contains 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) 2023 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: "[BE][FE][SECURITY] Update DEPENDENCIES files" | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Generate BE Dependencies file | |
run: mvn org.eclipse.dash:license-tool-plugin:license-check -Ddash.summary=DEPENDENCIES_BACKEND | |
- name: Run install | |
uses: borales/actions-yarn@v5 | |
with: | |
cmd: install | |
dir: 'frontend' | |
- name: Generate FE Dependencies file | |
uses: borales/actions-yarn@v5 | |
with: | |
cmd: run dependencies:generate | |
dir: 'frontend' | |
- name: Check if file was changed | |
run: | | |
if git diff --name-only ${{ github.base_ref }}...${{ github.sha }} | grep -e 'DEPENDENCIES_BACKEND' -e 'DEPENDENCIES_FRONTEND'; then | |
echo "The files were changed" | |
echo "were_files_changed=true" >> "$GITHUB_ENV" | |
git | |
else | |
echo "The file were not changed" | |
echo "were_files_changed=true" >> "$GITHUB_ENV" | |
echo "were_files_changed=false" >> "$GITHUB_ENV" | |
fi | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
if: ${{ env.were_files_changed }} == 'true' | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
add-paths: | | |
DEPENDENCIES_BACKEND | |
DEPENDENCIES_FRONTEND | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: action/dependencies | |
# base: ${{ github.ref }} | |
commit-message: Update Dependencies Backend Action | |
title: Update Dependencies Backend | |
body: | | |
Updates Dependencies | |
labels: automated, dependencies-check | |
if: ${{ env.were_files_changed }} == 'true' | |