Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(update-codeowners-from-packages): support global codeowners #194

Merged
merged 2 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions update-codeowners-from-packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ If you want to combine the automatically generated `CODEOWNERS` with the manuall
| ----------------- | -------- | ----------------------------------------------------- |
| token | true | The token for pull requests. |
| codeowners-manual | false | The path to the manually maintained `CODEOWNERS`. |
| global-codeowners | false | The GitHub IDs of global codeowners. |
| pr-base | false | Refer to `peter-evans/create-pull-request`. |
| pr-branch | false | The same as above. |
| pr-title | false | The same as above. |
Expand Down
7 changes: 7 additions & 0 deletions update-codeowners-from-packages/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ inputs:
description: ""
required: false
default: .github/CODEOWNERS-manual
global-codeowners:
description: ""
required: false
pr-base:
description: ""
required: false
Expand Down Expand Up @@ -69,6 +72,10 @@ runs:

for maintainer in $(grep '<maintainer' "$package_xml" | sed -E 's|.*email="(.*)".*|\1|' | sort -u); do
line+=" $maintainer"

if [ -n "${{ inputs.global-codeowners }}" ]; then
line+=" ${{ inputs.global-codeowners }}"
fi
done

echo "$line" >>.github/CODEOWNERS
Expand Down