Skip to content

Commit

Permalink
refactor: fix in create pr step (#843)
Browse files Browse the repository at this point in the history
Co-authored-by: V Thulisile Sibanda <[email protected]>
  • Loading branch information
14Richa and thulieblack authored Aug 16, 2023
1 parent ae34e0a commit 7731865
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/update-website-tsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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

0 comments on commit 7731865

Please sign in to comment.