From 86401148eafc2b0abe569294f482e93325860219 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Sun, 28 Jan 2024 16:37:36 +0100 Subject: [PATCH] Stricten working directory tests --- .github/workflows/ci.yml | 4 ++-- main.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da6dc18..2ba29b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: id: previoustag uses: ./ with: - workingDirecvtory: tmp/some/other/path + workingDirectory: tmp/some/other/path - run: | echo "Tag: ${{ steps.previoustag.outputs.tag }}" echo "Timestamp: ${{ steps.previoustag.outputs.timestamp }}" @@ -39,7 +39,7 @@ jobs: uses: therussiankid92/gat@v1 with: assertion: should.equal - expected: v1 + expected: 1.8.38 actual: ${{ steps.previoustag.outputs.tag }} get-previous-tag: name: Test Get Previous Tag on ${{ matrix.os }} diff --git a/main.js b/main.js index 2a2913a..d269b62 100644 --- a/main.js +++ b/main.js @@ -3,6 +3,8 @@ const fs = require('fs'); const tagPrefix = `${process.env.INPUT_PREFIX || ''}*`; const workingDirectory = process.env.INPUT_WORKINGDIRECTORY || null; +console.log('\x1b[33m%s\x1b[0m', 'Working directory: ', workingDirectory || ''); + exec(`git for-each-ref --sort=-creatordate --count 1 --format="%(refname:short)" "refs/tags/${tagPrefix}"`, {cwd: workingDirectory}, (err, tag, stderr) => { tag = tag.trim();