Skip to content

Commit

Permalink
minor fixes in maintainer-tsc workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
14Richa committed Aug 10, 2023
1 parent 40f396f commit 427a81d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 15 deletions.
35 changes: 24 additions & 11 deletions .github/workflows/maintainers-tsc-changes-verification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,34 @@ jobs:
if: needs.verify-changes.outputs.errorMessages != '[]'
runs-on: ubuntu-latest
steps:
- name: Comment and close the PR if there are are any critical changes done by human
- name: Comment and close the PR if there are any critical changes done by human
uses: actions/github-script@v6
with:
github-token: ${{ env.GITHUB_TOKEN }}
script: |
const rawErrorMessages = `${{ needs.verify-changes.outputs.errorMessages }}`;
const owner = context.repo.owner;
const repo = context.repo.repo;
const pull_number = context.issue.number;
const errorMessages = JSON.parse(rawErrorMessages);
const commentBody = errorMessages.join('\n');
github.rest.issues.createComment({ owner, repo, issue_number: pull_number, body: commentBody });
github.rest.pulls.update({ owner, repo, pull_number, state: 'closed' });
const errorMessages = ${{ needs.verify-changes.outputs.errorMessages }};
console.log('Parsed errorMessages:', errorMessages);
if (errorMessages && Array.isArray(errorMessages) && errorMessages.length > 0) {
const owner = context.repo.owner;
const repo = context.repo.repo;
const pull_number = context.issue.number;
const commentBody = errorMessages[0];
const commentContext = {
owner: owner,
repo: repo,
issue_number: pull_number,
body: commentBody
};
github.rest.issues.createComment(commentContext);
github.rest.pulls.update({
owner: owner,
repo: repo,
pull_number: pull_number,
state: 'closed'
});
} else {
console.info('rawErrorMessages is empty.');
}
bot-removal-notification:
needs: verify-changes
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/update-website-tsc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#This action update the list of TSC members in the website repository. List of all Maintainers is later rendered in the asyncapi.com website.
name: Update list of Maintainers in the website repo

on:
push:
branches:
- "master"
paths:
- "MAINTAINERS.yaml"

jobs:
update-website:
name: Make PR on website repository with updated maintainers list
Expand Down Expand Up @@ -39,12 +41,16 @@ jobs:
working-directory: ./website
run: |
cp ../community/MAINTAINERS.json ./config/MAINTAINERS.json
- name: Commit and push
- name: Check if there are changes
working-directory: ./website
run: |
git add .
git commit -m "docs(community): update latest maintainers list"
git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/website
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
else
echo "No changes to push."
fi
- name: Create PR
working-directory: ./website
run: |
Expand Down

0 comments on commit 427a81d

Please sign in to comment.