diff --git a/.github/workflows/maintain_cache.yml b/.github/workflows/maintain_cache.yml index 96c856624..0e82c6114 100644 --- a/.github/workflows/maintain_cache.yml +++ b/.github/workflows/maintain_cache.yml @@ -40,6 +40,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FILE_TO_COMMIT: garak/resources/plugin_cache.json DESTINATION_BRANCH: ${{ github.ref_name }} + COMMIT_RESULT: ${{ endsWith(github.ref_name, '/main')}} run: | if [ -f $HOME/.cache/garak/resources/plugin_cache.json ]; then echo "File updated from user cache" @@ -51,7 +52,7 @@ jobs: if [ $? -ne 0 ]; then set -e echo "Plugin cache updates exist" - if [ ${{ endsWith(github.ref_name, '/main')}} ]; then + if [ "$COMMIT_RESULT" = true ]; then export MESSAGE="automatic $FILE_TO_COMMIT update" export SHA=$( git rev-parse $DESTINATION_BRANCH:$FILE_TO_COMMIT ) cat <<- EOF > write_request.py