mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2025-12-24 20:31:27 +00:00
better create_list
This commit is contained in:
parent
0f3356b902
commit
016fa9564d
16
action.yml
16
action.yml
|
|
@ -61,7 +61,7 @@ runs:
|
|||
using: "composite"
|
||||
steps:
|
||||
- id: pre-cache
|
||||
run: |
|
||||
run: | #shell
|
||||
${GITHUB_ACTION_PATH}/pre_cache_action.sh \
|
||||
~/cache-apt-pkgs \
|
||||
"$VERSION" \
|
||||
|
|
@ -94,7 +94,7 @@ runs:
|
|||
|
||||
- id: post-cache
|
||||
if: ${{ env.CACHE_KEY }}
|
||||
run: |
|
||||
run: | #shell
|
||||
${GITHUB_ACTION_PATH}/post_cache_action.sh \
|
||||
~/cache-apt-pkgs \
|
||||
/ \
|
||||
|
|
@ -103,7 +103,15 @@ runs:
|
|||
"$DEBUG" \
|
||||
"$ADD_REPOSITORY" \
|
||||
"$PACKAGES"
|
||||
function create_list { local list=$(cat ~/cache-apt-pkgs/manifest_${1}.log | tr '\n' ','); echo ${list:0:-1}; };
|
||||
function create_list {
|
||||
local manifest_file=~/cache-apt-pkgs/manifest_${1}.log
|
||||
if [ -f "${manifest_file}" ]; then
|
||||
local list=$(cat "${manifest_file}" | tr '\n' ',')
|
||||
echo ${list:0:-1}
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
};
|
||||
echo "package-version-list=$(create_list main)" >> $GITHUB_OUTPUT
|
||||
echo "all-package-version-list=$(create_list all)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
|
@ -129,6 +137,6 @@ runs:
|
|||
key: ${{ steps.load-cache.outputs.cache-primary-key }}
|
||||
|
||||
- id: clean-cache
|
||||
run: |
|
||||
run: | #shell
|
||||
rm -rf ~/cache-apt-pkgs
|
||||
shell: bash
|
||||
|
|
|
|||
Loading…
Reference in a new issue