From 97b5f260330252061bcd8b7ce28fcad362de4a21 Mon Sep 17 00:00:00 2001 From: Ric Evans <19216225+ric-evans@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:16:52 -0600 Subject: [PATCH] keywords - 2 --- action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 6e8c8ac..4a30368 100644 --- a/action.yml +++ b/action.yml @@ -138,6 +138,16 @@ runs: shell: bash + - name: Prepare Keywords + if: env.IS_GIT_BEHIND != 'true' + run: | + CLEANED_KEYWORDS="${{ inputs.keywords }}" + # Wrap each line in quotes if not already quoted, then replace newlines with spaces + CLEANED_KEYWORDS=$(echo "$CLEANED_KEYWORDS" | sed 's/^[^"].*[^"]$/"&"/' | tr '\n' ' ') + echo "$CLEANED_KEYWORDS" + echo "CLEANED_KEYWORDS=$CLEANED_KEYWORDS" >> $GITHUB_ENV + shell: bash + - name: Build pyproject.toml + README.md (and commit) if: env.IS_GIT_BEHIND != 'true' run: | @@ -155,7 +165,7 @@ runs: --github-full-repo $GITHUB_REPOSITORY \ --token ${{ github.token }} \ --python-min "${{ inputs.python_min }}" \ - --keywords ${{ inputs.keywords | replace('\n', ' ') }} \ + --keywords $CLEANED_KEYWORDS \ --python-max "${{ inputs.python_max }}" \ --package-dirs ${{ inputs.package_dirs }} \ --exclude-dirs ${{ inputs.exclude_dirs }} \