diff --git a/.github/workflows/testdriver.yml b/.github/workflows/testdriver.yml index 91b806a..c29a39b 100644 --- a/.github/workflows/testdriver.yml +++ b/.github/workflows/testdriver.yml @@ -21,11 +21,12 @@ jobs: run: | FILES=$(ls ./testdriver/.generate/*.md) FILES_JSON=$(echo "$FILES" | jq -R -s -c 'split("\n")[:-1]') + echo "files=$FILES_JSON" >> $GITHUB_ENV echo "::set-output name=files::$FILES_JSON" test: needs: gather-markdown-files - name: "TestDriver - ${{ matrix.file_name }}" + name: "TestDriver - ${{ matrix.markdown }}" runs-on: ubuntu-latest strategy: matrix: @@ -37,19 +38,29 @@ jobs: - name: Extract file name id: extract_filename run: | - FILE_NAME=$(basename ${{ matrix.markdown }} .md) + FILE_NAME=$(basename "${{ matrix.markdown }}" .md) echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV + echo "File Name: $FILE_NAME" - - name: "Read markdown content" + - name: "Read markdown content and encode it" + id: encode_content run: | MARKDOWN_FILE=${{ matrix.markdown }} - echo "MARKDOWN_CONTENT=$(cat $MARKDOWN_FILE)" >> $GITHUB_ENV + MARKDOWN_CONTENT=$(cat "$MARKDOWN_FILE" | base64) + echo "MARKDOWN_CONTENT=$MARKDOWN_CONTENT" >> $GITHUB_ENV + echo "Markdown content encoded." + + - name: Decode markdown content for prompt + id: decode_content + run: | + DECODED_MARKDOWN_CONTENT=$(echo "$MARKDOWN_CONTENT" | base64 --decode) + echo "DECODED_MARKDOWN_CONTENT=$DECODED_MARKDOWN_CONTENT" >> $GITHUB_ENV + echo "Decoded markdown content: $DECODED_MARKDOWN_CONTENT" - uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} - prompt: | - ${{ env.MARKDOWN_CONTENT }} + prompt: ${{ env.DECODED_MARKDOWN_CONTENT }} prerun: | cd $env:TEMP npm init -y