From 8c7bb902257acc0cfe55d5ebd93bc7e844ae9a66 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Sun, 20 Dec 2020 20:21:58 +0000 Subject: [PATCH] :construction_worker_man: sync DINAR Pushed from https://github.com/itpp-labs/DINAR/.github/workflows/fork2repos.yml --- .github/workflows/DINAR-PORT.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DINAR-PORT.yml b/.github/workflows/DINAR-PORT.yml index 7d3a507..2bbd3e7 100644 --- a/.github/workflows/DINAR-PORT.yml +++ b/.github/workflows/DINAR-PORT.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest if: "startsWith(github.event.issue.title, 'DINAR-PORT ')" steps: - - name: Post a message + - name: Post link uses: KeisukeYamashita/create-comment@v1 with: comment: @@ -87,12 +87,26 @@ jobs: pip install -e ./odoo-module-migrator - name: apply OCA/odoo-module-migrator run: | + LOG_FILE=../odoo-module-migrator.logs cd REPO odoo-module-migrate \ --modules ${{ env.PORT_MODULE }} \ --init-version-name ${{ env.PORT_FROM_BRANCH }} \ --target-version-name ${{ env.PORT_TO_BRANCH }} \ - --no-commit + --no-commit \ + 2> $LOG_FILE || true + cat $LOG_FILE + + # remove colors + sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" $LOG_FILE + # escape character + # TODO: update KeisukeYamashita/create-comment to support reading comment's body from file + body=$(cat $LOG_FILE) + body="${body//'%'/'%25'}" + body="${body//$'\n'/'%0A'}" + body="${body//$'\r'/'%0D'}" + echo "MIGRATOR_LOGS=$body" >> $GITHUB_ENV + git add -A git commit -m ":arrow_up:${{ env.PORT_TO_BRANCH_TAGS }} OCA/odoo-module-migrator @@ -108,6 +122,7 @@ jobs: > Made via .github/workflows/DINAR-PORT.yml" || echo "pre-commit: no changes" - name: PR uses: peter-evans/create-pull-request@v3 + id: cpr with: path: REPO # GITHUB_TOKEN would not trigger PR checks @@ -116,3 +131,13 @@ jobs: title: "[${{ env.PORT_TO_BRANCH }}] ${{ env.PORT_MODULE }}" body: | Made by [DINAR](https://github.com/itpp-labs/DINAR#readme) by request in #${{ github.event.issue.number }} + - name: Post logs + uses: KeisukeYamashita/create-comment@v1 + with: + number: ${{ steps.cpr.outputs.pull-request-number }} + comment: | + [Migrator](https://github.com/OCA/odoo-module-migrator/)'s logs: + + ``` + ${{ env.MIGRATOR_LOGS }} + ```