Update EEA Files #764
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
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com) and contributors | |
# SPDX-FileContributor: Sebastian Thomschke (https://sebthom.de), Vegard IT GmbH (https://vegardit.com) | |
# SPDX-License-Identifier: EPL-2.0 | |
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/no-npe | |
# | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
name: Update EEA Files | |
on: | |
schedule: | |
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows | |
- cron: '0 5 * * *' # daily at 5 a.m. | |
workflow_dispatch: | |
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ | |
inputs: | |
additional_maven_args: | |
description: 'Additional Maven Args' | |
required: false | |
default: '' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
########################################################### | |
build: | |
########################################################### | |
runs-on: ubuntu-latest | |
steps: | |
- name: Show environment variables | |
run: env | sort | |
- name: Git Checkout | |
uses: actions/checkout@v4 # https://github.com/actions/checkout | |
- name: "Install: JDK 11" | |
uses: actions/setup-java@v4 # https://github.com/actions/setup-java | |
with: | |
distribution: temurin | |
java-version: 11 | |
- run: echo "JAVA11_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
- name: "Install: JDK 17" | |
uses: actions/setup-java@v4 # https://github.com/actions/setup-java | |
with: | |
distribution: temurin | |
java-version: 17 | |
- run: echo "JAVA17_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
- name: "Install: JDK 21" | |
uses: actions/setup-java@v4 # https://github.com/actions/setup-java | |
with: | |
distribution: temurin | |
java-version: 21 | |
- run: echo "JAVA21_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
- name: "Cache: Restore" | |
id: cache-restore | |
if: ${{ !env.ACT }} # https://github.com/nektos/act#skipping-steps | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.m2/bin | |
~/.m2/repository | |
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} | |
- name: Update EEA Files | |
id: eea_updates | |
run: | | |
set -euo pipefail | |
bash .ci/update-eea-files.sh ${{ github.event.inputs.additional_maven_args }} | |
updates=$(git -C . ls-files -o -m -d --exclude-standard) | |
if [[ -z $updates ]]; then | |
echo "updates=" >> "$GITHUB_OUTPUT" | |
else | |
# https://github.com/orgs/community/discussions/26288#discussioncomment-3876281 | |
delimiter="$(openssl rand -hex 8)" | |
echo "updates<<${delimiter}" >> "${GITHUB_OUTPUT}" | |
echo "${updates}" >> "${GITHUB_OUTPUT}" | |
echo "${delimiter}" >> "${GITHUB_OUTPUT}" | |
fi | |
- name: Create PR | |
id: create-pr | |
uses: peter-evans/create-pull-request@v6 # https://github.com/peter-evans/create-pull-request | |
if: "${{ steps.eea_updates.outputs.updates != '' }}" | |
with: | |
title: "chore: Update EEA Files" | |
author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" | |
committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" | |
commit-message: "chore: Update EEA Files" | |
body: ${{ steps.eea_updates.outputs.updates }} | |
add-paths: libs | |
branch: eea_updates | |
delete-branch: true | |
token: ${{ github.token }} |