Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add appstream validator action #38

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions appstream-validator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM debian:stable-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y appstream-util

# create and use an elementary user instead of root
RUN groupadd -r elementary && useradd --no-log-init -r -g elementary elementary

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
20 changes: 20 additions & 0 deletions appstream-validator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Appstream Validator Action

This action runs appstream-util to validate/verify the contents of a project's appdata file.

## Requirements

This image is intended for use with elementary debian projects. There are a few requirements before getting started:

1. The project needs an `appdata.xml` file in the `data` directory of the project. Docs: [appdata](https://elementary.io/docs/code/getting-started#appdata)

## Example

```yaml
jobs:
validate-appstream-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: elementary/actions/appstream-validator@master
```
8 changes: 8 additions & 0 deletions appstream-validator/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: 'Validate Appstream Data'
description: 'Validate appstream data'
runs:
using: 'docker'
image: 'Dockerfile'
branding:
icon: 'git-pull-request'
color: 'green'
5 changes: 5 additions & 0 deletions appstream-validator/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e

# Validate Appdata
appstream-util validate-relax --nonet "$(find data -name "*appdata*")"