Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/validate-flatpaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Validate Flatpaks
permissions:
contents: read

on:
pull_request:
paths:
- "flatpaks/**"
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5

- name: Set up Flathub
shell: bash
run: |
sudo apt install -y flatpak
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

- name: Validate Flatpaks
shell: bash
run: |
echo "Validating flatpak files in flatpaks/ directory..."

set -xeuo pipefail

find "flatpaks" -iname '*\.list*' -print0 | \
while IFS= read -r -d '' flatpaks_file ; do \
echo "::group:: ===$(basename "$flatpaks_file")==="
grep -v "#.*" "$flatpaks_file" | \

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
grep -v "#.*" "$flatpaks_file" | \
sed 's/#.*//' "$flatpaks_file" | grep -v '^[[:space:]]*$' | \

Copilot uses AI. Check for mistakes.
while read -r flatpak ; do \

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'.

Suggested change
while read -r flatpak ; do \
while read -r flatpak ; do \
[[ -n "$flatpak" ]] || continue \

Copilot uses AI. Check for mistakes.
flatpak remote-info --user flathub "${flatpak}"
done
echo "::endgroup::"
done