Skip to content

Commit

Permalink
ci: trigger MAINTAINERS.yaml update for each CODEOWNERS file change (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mszostok authored Aug 21, 2024
1 parent e27f9f1 commit 2751ab4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/global-replicator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,24 @@ jobs:
committer_username: asyncapi-bot
committer_email: [email protected]
commit_message: "ci: update .prettierignore from global .github repo"
bot_branch_name: bot/update-files-from-global-repo
bot_branch_name: bot/update-files-from-global-repo

# This setup is separate from the generic workflow setup because this workflow is mandatory.
# Maintainers cannot opt out for any reason except technical ones.
replicate_update_maintainers_workflow:
if: startsWith(github.repository, 'asyncapi/')
name: Replicate update-maintainers-trigger.yml workflow in the required repositories
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Replicating file
uses: derberg/manage-files-in-multiple-repositories@beecbe897cf5ed7f3de5a791a3f2d70102fe7c25
with:
github_token: ${{ secrets.GH_TOKEN }}
patterns_to_include: .github/workflows/update-maintainers-trigger.yml
repos_to_ignore: community,shape-up-process # community repo is ignored as it has its own version of this workflow, version that is triggered by this workflow
committer_username: asyncapi-bot
committer_email: [email protected]
commit_message: "ci: update update-maintainers-trigger.yml workflow from global .github repo"
bot_branch_name: bot/update-files-from-global-repo
28 changes: 28 additions & 0 deletions .github/workflows/update-maintainers-trigger.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This action is centrally managed in https://github.com/asyncapi/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo

name: Trigger MAINTAINERS.yaml file update

on:
push:
branches: [ master ]
paths:
# Check all valid CODEOWNERS locations:
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-location
- 'CODEOWNERS'
- '.github/CODEOWNERS'
- '.docs/CODEOWNERS'

jobs:
trigger-maintainers-update:
name: Trigger updating MAINTAINERS.yaml because of CODEOWNERS change
runs-on: ubuntu-latest

steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # https://github.com/peter-evans/repository-dispatch/releases/tag/v3.0.0
with:
# The PAT with the 'public_repo' scope is required
token: ${{ secrets.GH_TOKEN }}
repository: ${{ github.repository_owner }}/community
event-type: trigger-maintainers-update

0 comments on commit 2751ab4

Please sign in to comment.