From 642c067124f376cf8771d839c8d8e50ed8e03221 Mon Sep 17 00:00:00 2001 From: Adrian Stobbe Date: Thu, 16 Nov 2023 13:48:49 +0100 Subject: [PATCH] use absolute path and env --- .github/actions/gh_create_issue/action.yml | 4 ++-- .github/actions/gh_create_issue/create_issue.sh | 10 +++++----- .github/actions/notify_e2e_failure/action.yml | 17 ++++++++--------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/actions/gh_create_issue/action.yml b/.github/actions/gh_create_issue/action.yml index e319e18518e..17adf6593df 100644 --- a/.github/actions/gh_create_issue/action.yml +++ b/.github/actions/gh_create_issue/action.yml @@ -20,8 +20,8 @@ inputs: body: description: "The body of the issue." required: false - body-file: - description: "The path to a file containing the body of the issue." + body-file-absolute-path: + description: "The absolute path to a file containing the body of the issue." required: false assignee: description: "The GitHub username to assign the issue to." diff --git a/.github/actions/gh_create_issue/create_issue.sh b/.github/actions/gh_create_issue/create_issue.sh index beee9c947aa..8d3c76bfed9 100755 --- a/.github/actions/gh_create_issue/create_issue.sh +++ b/.github/actions/gh_create_issue/create_issue.sh @@ -219,9 +219,9 @@ function setFields() { function main() { inputFile="$(realpath "${1}")" - #workdir=$(mktemp -d) - #pushd "${workdir}" > /dev/null - #trap 'debug "not cleaning up, working directory at: ${workdir}"' ERR + workdir=$(mktemp -d) + pushd "${workdir}" > /dev/null + trap 'debug "not cleaning up, working directory at: ${workdir}"' ERR issueURL=$(createIssue) echo "${issueURL}" @@ -241,8 +241,8 @@ function main() { setFields "${projectID}" "${issueItemID}" - #popd > /dev/null - #rm -rf "${workdir}" + popd > /dev/null + rm -rf "${workdir}" } main "${@}" diff --git a/.github/actions/notify_e2e_failure/action.yml b/.github/actions/notify_e2e_failure/action.yml index 148a9599b7f..9f60d85288e 100644 --- a/.github/actions/notify_e2e_failure/action.yml +++ b/.github/actions/notify_e2e_failure/action.yml @@ -34,7 +34,7 @@ runs: - name: Get the current date id: date shell: bash - run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S')" + run: echo "CURRENT_DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV - name: Create body template id: body-template @@ -53,17 +53,14 @@ runs: EOF - cat header.md .github/failure_project_template.md > .github/body.md - - - run: cat .github/body.md - shell: bash + cat header.md .github/failure_project_template.md > body.md + echo "BODY_PATH=$(pwd)/body.md" >> $GITHUB_ENV - uses: ./.github/actions/gh_create_issue id: gh_create_issue with: - title: "${{ inputs.test }} - ${{ steps.date.outputs.date }}" - #body: test // TODO - body-file: .github/body.md + title: "${{ inputs.test }} - ${{ env.CURRENT_DATE }}" + body-file-absolute-path: ${{ env.BODY_PATH }} repo: issues label: "e2e failure" workflow: ${{ github.workflow }} @@ -75,7 +72,9 @@ runs: test: ${{ inputs.test }} refStream: ${{ inputs.refStream }} token: ${{ inputs.projectWriteToken }} - - run: echo ${{ steps.gh_create_issue.outputs.issue-url }} # TODO rm + + - name: Issue URL + run: echo ${{ steps.gh_create_issue.outputs.issue-url }} # TODO rm shell: bash - name: Create project card in case of failure