Skip to content

Commit ab9ea0e

Browse files
p5EyeCantCU
andauthored
fix: support comma separated files input (#3)
* Add test cases for multiple spec files * Cleanup dnf cache after installing * Accept comma-separated list of spec files * Update comment (remove Copilot prompt) * chore(ci): Add test for comma separated rpmfiles, and set rpmlint as permissive * chore(ci): Perform tests on pull request * chore(ci): Disable permissive --------- Co-authored-by: RJ Trujillo <eyecantcu@pm.me>
1 parent b273cb6 commit ab9ea0e

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

.github/workflows/test-action.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Test Action
22
on:
3+
pull_request:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '**.md'
8+
- '**.txt'
39
push:
410
branches:
511
- main
@@ -26,8 +32,14 @@ jobs:
2632
- name: Fetch spec
2733
run: |
2834
wget https://raw.githubusercontent.com/ublue-os/packages/main/staging/devpod/devpod.spec
35+
wget https://raw.githubusercontent.com/ublue-os/packages/main/staging/prompt/prompt.spec
2936
30-
- name: Test rpmlint
37+
- name: Test rpmlint (single file)
3138
uses: ./
3239
with:
3340
rpmfiles: ./devpod.spec
41+
42+
- name: Test rpmlint (multiple files)
43+
uses: ./
44+
with:
45+
rpmfiles: './devpod.spec, ./prompt.spec'

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ author: 'EyeCantCU'
33
description: 'Checks for errors in RPMs via rpmlint'
44
inputs:
55
rpmfiles:
6-
description: 'Files to be validated by rpmlint'
6+
description: 'Comma-separated list of files to be validated by rpmlint'
77
required: false
88
help:
99
description: 'Show help message and exit'

container/Containerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
FROM quay.io/fedora/fedora-minimal:39 AS rpmlint-action
22

3-
RUN dnf5 install -y rpmlint
3+
RUN dnf5 install -y rpmlint && dnf5 clean all

rpmlint.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ if [[ -n "${PERMISSIVE}" ]]; then ARGUMENTS+=" -p "; fi
2020
# Format arguments
2121
ARGUMENTS=$(echo "$ARGUMENTS" | xargs)
2222

23-
# Perform rpmlint
23+
# Perform rpmlint on comma-separated list of files
2424
if [[ -n "${RPMFILES}" ]]; then
25-
rpmlint $ARGUMENTS ${RPMFILES[@]}
25+
for FILE in $(echo "${RPMFILES}" | tr "," "\n"); do
26+
rpmlint $ARGUMENTS $FILE
27+
done
2628
else
2729
rpmlint $ARGUMENTS
2830
fi

0 commit comments

Comments
 (0)