Automatic workflow to update yandex-music ebuild
Some checks failed
yandex-music / check-and-update (push) Failing after 29s

This commit was merged in pull request #1.
This commit is contained in:
Petr Polezhaev
2026-02-02 15:40:24 +03:00
committed by Petr Polezhaev
parent 6e6228033f
commit 32173db78b
17 changed files with 254 additions and 161 deletions

View File

@@ -0,0 +1,34 @@
name: "Copy the latest ebuild for the package as version given"
description: "Checks if the ebuild with the specified version exists and if not - copies the latest existing one over"
inputs:
atom:
description: "category/name package atom"
required: true
version:
description: "the desired version of the ebuild"
required: true
outputs:
message:
description: "space separated list of versions added"
value: ${{ steps.copy.outputs.message }}
runs:
using: composite
steps:
- id: copy
shell: bash
run: |
set -euo pipefail
ebuild_dir="./${{ inputs.atom }}"
name=$(basename "${{ inputs.atom }}")
want_ebuild="${ebuild_dir}/${name}-${{ inputs.version }}.ebuild"
message=""
if [[ -f "${want_ebuild}" ]]; then
echo "Ebuild already exists"
else
existing_ebuilds=( "${ebuild_dir}"/*.ebuild )
latest_existing_ebuild="${existing_ebuilds[-1]}"
echo "Copying ${latest_existing_ebuild} to ${want_ebuild}"
cp "${latest_existing_ebuild}" "${want_ebuild}"
message="add ${{ inputs.version }}"
fi
echo "message=${message}" >> "${GITHUB_OUTPUT}"