Skip to content

Commit

Permalink
feat: add library input to update-eea-files workflow
Browse files Browse the repository at this point in the history
Signed-off-by: sebthom <sebthom@users.noreply.github.com>
  • Loading branch information
sebthom committed Sep 8, 2024
1 parent 84c102e commit 6ac5bc1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/update-eea-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
description: 'Additional Maven Args'
required: false
default: ''
library:
description: 'Name of the library to update (e.g. java-17). If left empty all libraries are updated.'
required: false
default: ''


defaults:
Expand Down Expand Up @@ -73,6 +77,7 @@ jobs:

- name: "Cache: Local Maven Repository"
uses: actions/cache@v4
if: ${{ !github.event.inputs.additional_maven_args && !github.event.inputs.library }}
with:
# Excluded sub directory not working https://github.com/actions/toolkit/issues/713
path: |
Expand All @@ -98,9 +103,10 @@ jobs:
--no-transfer-progress \
--batch-mode \
--show-version \
${{ github.event.inputs.additional_maven_args }} \
clean verify \
-Deea-generator.action=generate
$( [[ -n "${{ github.event.inputs.library }}" ]] && echo '-pl "libraries/${{ github.event.inputs.library }}" -am' || true ) \
-Deea-generator.action=generate \
${{ github.event.inputs.additional_maven_args }}
updates=$(git -C . ls-files -o -m -d --exclude-standard | head -n 50 || true) # "|| true" is to mitgate exit code 141
Expand All @@ -118,14 +124,14 @@ jobs:
- 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 != '' }}"
if: steps.eea_updates.outputs.updates
with:
title: "chore: Update EEA Files"
title: "chore: Update ${{ github.event.inputs.library && format('{0} ', github.event.inputs.library) || '' }}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"
commit-message: "chore: Update EEA ${{ github.event.inputs.library && format('{0} ', github.event.inputs.library) || '' }}files"
body: ${{ steps.eea_updates.outputs.updates }}
add-paths: libraries
branch: eea_updates
branch: ${{ github.event.inputs.library && format('eea_{0}_updates', github.event.inputs.library) || 'eea_updates' }}
delete-branch: true
token: ${{ github.token }}

0 comments on commit 6ac5bc1

Please sign in to comment.