Allow building in a subdirectory

This commit is contained in:
2026-01-03 22:00:12 +01:00
parent ba8619dda5
commit 2fdc6b54d1
+6 -3
View File
@@ -11,6 +11,9 @@ inputs:
fedora_release:
description: The fedora release version to build for
required: true
specdir:
description: A directory to switch to before trying to find a spec file.
required: false
specfile:
description: The filename of the spec file to build. If not set and there is only 1 specfile, it will be selected automatically.
required: false
@@ -22,12 +25,12 @@ runs:
shell: bash
run: |
set -e
echo Switching to ${{ gitea.workspace }} to prepare ${{ gitea.repository }}
cd ${{ gitea.workspace }}
echo Switching to ${{ gitea.workspace }}/${{ inputs.specdir }} to prepare a src.rpm from ${{ gitea.repository }}
cd ${{ gitea.workspace }}/${{ inputs.specdir }}
# Derive the name of the .spec file
SPECFILE=$([ "${{ inputs.specfile }}" ] && echo -n "${{ inputs.specfile }}" || echo -n $([ $(ls -1 *.spec 2>/dev/null| wc -l) -eq 1 ] && echo -n "$(ls -1 *.spec)"))
[ "$SPECFILE" == "" ] && exit 1
[ "$SPECFILE" == "" ] && echo Could\'t find a singular spec file to use && exit 1
echo Specfile is $SPECFILE
echo Downloading source archive