Skip to content

Commit 245d426

Browse files
ci: Explicitly set mise trusted configs (#118)
1 parent 8f9ab02 commit 245d426

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/actions/mise-project-setup/action.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,41 @@ runs:
4848
version: ${{ steps.init.outputs.mise-version }}
4949
working_directory: ${{ inputs.directory }}
5050

51+
- env:
52+
DIRECTORIES: ${{ steps.init.outputs.mise-install-directories }}
53+
run: |
54+
# Set mise trusted config paths
55+
56+
# Unset MISE_TRUSTED_CONFIG_PATHS for this step
57+
unset MISE_TRUSTED_CONFIG_PATHS
58+
59+
envValues=""
60+
for dir in ${DIRECTORIES}; do
61+
echo "::group::Set mise trusted config paths: ${dir}"
62+
pushd "${dir}"
63+
echo "Show trust status before setting"
64+
mise trust --show
65+
echo "Set as trusted"
66+
mise trust .
67+
echo "Show trust status after setting"
68+
mise trust --show
69+
popd
70+
echo "::endgroup::"
71+
72+
if [ -n "${envValues}" ]; then
73+
envValues="${envValues}:"
74+
fi
75+
fullPath=$(realpath .)
76+
envValues="${envValues}${fullPath}"
77+
done
78+
79+
echo "::group::Set mise trusted config paths to environment: ${envValues}"
80+
{
81+
echo "MISE_TRUSTED_CONFIG_PATHS=${envValues}"
82+
} | tee -a "${GITHUB_ENV}"
83+
echo "::endgroup::"
84+
shell: bash
85+
5186
- if: steps.cache-restore.outputs.cache-hit != 'true'
5287

5388
env:

0 commit comments

Comments
 (0)