diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml index cefe737..c7e6a25 100644 --- a/.github/workflows/build-snap.yml +++ b/.github/workflows/build-snap.yml @@ -18,6 +18,19 @@ jobs: steps: - uses: actions/checkout@v7 + # Default icon: the org avatar. Repos may override it by shipping + # their own snap/gui/icon.png (checked out above, if present). + - name: 🖼️ Fetch default icon + env: + GH_TOKEN: ${{ github.token }} + run: | + if [[ ! -f snap/gui/icon.png ]]; then + mkdir -p snap/meta/gui + org_id="$(curl -fsSL https://api.github.com/orgs/obs-plugins-snaps | jq -r .id)" + curl -fsSL -o snap/gui/icon.png \ + "https://avatars.githubusercontent.com/u/${org_id}?size=256" + fi + - uses: canonical/craft-actions/snapcraft/pack@main id: pack