From 7731865bef88ce129f7c7d23a6b1844ebc1f5fd5 Mon Sep 17 00:00:00 2001 From: Richa <41283476+14Richa@users.noreply.github.com> Date: Thu, 17 Aug 2023 00:52:06 +0530 Subject: [PATCH] refactor: fix in create pr step (#843) Co-authored-by: V Thulisile Sibanda <66913810+thulieblack@users.noreply.github.com> --- .../maintainers-tsc-changes-verification.yaml | 2 +- .github/workflows/update-website-tsc.yml | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maintainers-tsc-changes-verification.yaml b/.github/workflows/maintainers-tsc-changes-verification.yaml index 3b7efada1..b6fe1b352 100644 --- a/.github/workflows/maintainers-tsc-changes-verification.yaml +++ b/.github/workflows/maintainers-tsc-changes-verification.yaml @@ -126,7 +126,7 @@ jobs: with: github-token: ${{ env.GITHUB_TOKEN }} script: | - const errorMessagesString = '${{ needs.verify-changes-if-tsc-if-maintainers.outputs.errorMessages }}'; + const errorMessagesString = `${{ needs.verify-changes-if-tsc-if-maintainers.outputs.errorMessages }}`; const errorMessages = errorMessagesString ? JSON.parse(errorMessagesString) : []; console.log('Parsed errorMessages:', errorMessages); if (errorMessages && Array.isArray(errorMessages) && errorMessages.length > 0) { diff --git a/.github/workflows/update-website-tsc.yml b/.github/workflows/update-website-tsc.yml index cbbedf540..617bf77d7 100644 --- a/.github/workflows/update-website-tsc.yml +++ b/.github/workflows/update-website-tsc.yml @@ -42,16 +42,20 @@ jobs: run: | cp ../community/MAINTAINERS.json ./config/MAINTAINERS.json - name: Check if there are changes + id: check_changes working-directory: ./website run: | if ! git diff --quiet; then git add . git commit -m "docs(community): update latest maintainers list" git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website + echo "CHANGES=true" >> $GITHUB_ENV else - echo "No changes to push." + echo "No changes to commit." + echo "CHANGES=false" >> $GITHUB_ENV fi - - name: Create PR + - name: Create PR if there are changes + if: steps.check_changes.outputs.CHANGES == 'true' working-directory: ./website run: | gh pr create --title "docs(community): update latest maintainers list" --body "Updated Maintainers list is available and this PR introduces changes with latest information about Maintainers" --head "update-tscmembers-${{ github.sha }}" @@ -62,4 +66,4 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} SLACK_TITLE: 🚨 Update maintainers list action failed 🚨 SLACK_MESSAGE: Failed to update the maintainers list in the website repository. - MSG_MINIMAL: true + MSG_MINIMAL: true \ No newline at end of file