mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2026-05-10 20:13:20 +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"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- id: pre-cache
|
- id: pre-cache
|
||||||
run: |
|
run: | #shell
|
||||||
${GITHUB_ACTION_PATH}/pre_cache_action.sh \
|
${GITHUB_ACTION_PATH}/pre_cache_action.sh \
|
||||||
~/cache-apt-pkgs \
|
~/cache-apt-pkgs \
|
||||||
"$VERSION" \
|
"$VERSION" \
|
||||||
|
|
@ -94,7 +94,7 @@ runs:
|
||||||
|
|
||||||
- id: post-cache
|
- id: post-cache
|
||||||
if: ${{ env.CACHE_KEY }}
|
if: ${{ env.CACHE_KEY }}
|
||||||
run: |
|
run: | #shell
|
||||||
${GITHUB_ACTION_PATH}/post_cache_action.sh \
|
${GITHUB_ACTION_PATH}/post_cache_action.sh \
|
||||||
~/cache-apt-pkgs \
|
~/cache-apt-pkgs \
|
||||||
/ \
|
/ \
|
||||||
|
|
@ -103,7 +103,15 @@ runs:
|
||||||
"$DEBUG" \
|
"$DEBUG" \
|
||||||
"$ADD_REPOSITORY" \
|
"$ADD_REPOSITORY" \
|
||||||
"$PACKAGES"
|
"$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 "package-version-list=$(create_list main)" >> $GITHUB_OUTPUT
|
||||||
echo "all-package-version-list=$(create_list all)" >> $GITHUB_OUTPUT
|
echo "all-package-version-list=$(create_list all)" >> $GITHUB_OUTPUT
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
@ -129,6 +137,6 @@ runs:
|
||||||
key: ${{ steps.load-cache.outputs.cache-primary-key }}
|
key: ${{ steps.load-cache.outputs.cache-primary-key }}
|
||||||
|
|
||||||
- id: clean-cache
|
- id: clean-cache
|
||||||
run: |
|
run: | #shell
|
||||||
rm -rf ~/cache-apt-pkgs
|
rm -rf ~/cache-apt-pkgs
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue