chore(tweet): recurring tweet about slack link (#1560) #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
steps: | |
- name: Checkout Current repository | |
uses: actions/checkout@v2 | |
with: | |
path: community | |
- name: Checkout Another repository | |
uses: actions/checkout@v2 | |
with: | |
repository: asyncapi/website | |
path: website | |
token: ${{ env.GITHUB_TOKEN }} | |
- name: Config git | |
run: | | |
git config --global user.name asyncapi-bot | |
git config --global user.email [email protected] | |
- name: Create branch | |
working-directory: ./website | |
run: | | |
git checkout -b update-tscmembers-${{ github.sha }} | |
- name: Convert YAML to JSON using Python | |
working-directory: ./community | |
run: | | |
python -c 'import sys, yaml, json; json.dump(yaml.safe_load(sys.stdin), sys.stdout, indent=4)' < MAINTAINERS.yaml > MAINTAINERS.json | |
- name: Copy maintainers file from Current Repo to Another | |
working-directory: ./website | |
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_OUTPUT | |
else | |
echo "No changes to commit." | |
echo "CHANGES=false" >> $GITHUB_OUTPUT | |
fi | |
- 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 }}" | |
- name: Report workflow run status to Slack | |
if: failure() # Only, on failure, send a message on the slack channel | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
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 |