From 760b4a7beae893d6fa3a4a7d16714c7ecd755572 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 | 2 +- .../actions/gh_create_issue/create_issue.sh | 10 +++++----- .github/actions/notify_e2e_failure/action.yml | 19 +++++++++---------- 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 e319e18518..4c960a2ba0 100644 --- a/.github/actions/gh_create_issue/action.yml +++ b/.github/actions/gh_create_issue/action.yml @@ -21,7 +21,7 @@ inputs: description: "The body of the issue." required: false body-file: - description: "The path to a file containing the body of the issue." + 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 beee9c947a..8d3c76bfed 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 148a9599b7..ea5afd1ce8 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,29 +53,28 @@ 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: ${{ env.BODY_PATH }} repo: issues label: "e2e failure" - workflow: ${{ github.workflow }} assignee: ${{ steps.pick-assignee.outputs.assignee }} project: Constellation bugs fields: | + workflow: ${{ github.workflow }} kubernetesVersion: ${{ inputs.kubernetesVersion }} cloudProvider: ${{ inputs.provider }} 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