Automatic workflow to update yandex-music ebuild
Some checks failed
yandex-music / check-and-update (push) Failing after 29s
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:
34
.gitea/actions/copy-latest-ebuild-as/action.yml
Normal file
34
.gitea/actions/copy-latest-ebuild-as/action.yml
Normal 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}"
|
||||
Reference in New Issue
Block a user