feat: add flatpak validation workflow - #1135
Conversation
|
Think this fine to go |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces automated validation for Flatpak application IDs listed in the repository's flatpak configuration files. The workflow ensures that all referenced Flatpak applications exist in the Flathub repository before they are merged.
- Adds a new GitHub Actions workflow that triggers on changes to flatpak configuration files
- Validates each Flatpak ID against the Flathub remote repository
- Uses GitHub Actions grouping for better log readability
| find "flatpaks" -iname '*\.list*' -print0 | \ | ||
| while IFS= read -r -d '' flatpaks_file ; do \ | ||
| echo "::group:: ===$(basename "$flatpaks_file")===" | ||
| grep -v "#.*" "$flatpaks_file" | \ |
There was a problem hiding this comment.
The grep pattern '#.' will only filter lines that start with '#'. Lines with comments after content (e.g., 'app.id # comment') will not be properly filtered. Use 'sed 's/#.//' to remove inline comments or adjust the pattern to '^[[:space:]]*#' to only skip comment-only lines.
| grep -v "#.*" "$flatpaks_file" | \ | |
| sed 's/#.*//' "$flatpaks_file" | grep -v '^[[:space:]]*$' | \ |
| while IFS= read -r -d '' flatpaks_file ; do \ | ||
| echo "::group:: ===$(basename "$flatpaks_file")===" | ||
| grep -v "#.*" "$flatpaks_file" | \ | ||
| while read -r flatpak ; do \ |
There was a problem hiding this comment.
Empty lines from the grep output will cause 'flatpak remote-info' to fail with an invalid argument. Add a check to skip empty lines: 'while read -r flatpak ; do [[ -n "$flatpak" ]] || continue'.
| while read -r flatpak ; do \ | |
| while read -r flatpak ; do \ | |
| [[ -n "$flatpak" ]] || continue \ |
No description provided.