mirror of
https://github.com/hassio-addons/repository-updater.git
synced 2025-05-03 18:41:21 +00:00
Add GitHub Action support
This commit is contained in:
parent
6030501397
commit
ccddcfe4f4
3 changed files with 61 additions and 0 deletions
27
action.yaml
Normal file
27
action.yaml
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
name: "Community Home Assistant Add-ons Repository Updater"
|
||||
description: Tool for updating Home Assistant Add-on repositories.
|
||||
author: frenck
|
||||
|
||||
branding:
|
||||
color: red
|
||||
icon: thumbs-up
|
||||
|
||||
inputs:
|
||||
token:
|
||||
description: GitHub token that is allowed to write/commit to the target repo
|
||||
required: true
|
||||
repository:
|
||||
description: The add-on repository to update (e.g., frenck/repository)
|
||||
required: false
|
||||
addon:
|
||||
description: Slug of the add-on to update the repository for
|
||||
required: false
|
||||
force:
|
||||
description: Force repository update, even if no changes are detected
|
||||
default: "false"
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "docker"
|
||||
image: "action/Dockerfile"
|
12
action/Dockerfile
Normal file
12
action/Dockerfile
Normal file
|
@ -0,0 +1,12 @@
|
|||
FROM python:3.9-alpine
|
||||
|
||||
RUN \
|
||||
apk add --no-cache \
|
||||
git=2.26.2-r0 \
|
||||
\
|
||||
&& pip3 install \
|
||||
repository-updater==0.6.0
|
||||
|
||||
COPY lint.py /lint.py
|
||||
|
||||
ENTRYPOINT ["python3", "/lint.py"]
|
22
action/entrypoint.sh
Normal file
22
action/entrypoint.sh
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
declare -a options
|
||||
|
||||
options+=(--token "${INPUT_TOKEN:-}")
|
||||
|
||||
if [[ -n "${INPUT_ADDON:-}" ]]; then
|
||||
options+=(--repository "${INPUT_ADDON}")
|
||||
else
|
||||
options+=(--repository "${GITHUB_REPOSITORY}")
|
||||
fi
|
||||
|
||||
[[ -n "${INPUT_ADDON:-}" ]] \
|
||||
&& options+=(--addon "${INPUT_ADDON}")
|
||||
|
||||
[[ "${INPUT_FORCE,,}" = "true" ]] \
|
||||
&& options+=(--force)
|
||||
|
||||
# Output version
|
||||
repository-updater --version
|
||||
|
||||
# Update!
|
||||
exec repository-updater "${options[@]}"
|
Loading…
Add table
Add a link
Reference in a new issue