-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] run codeowner check on PRs (#36285)
Co-authored-by: Evan Bradley <[email protected]>
- Loading branch information
1 parent
da8f7c5
commit d797bf5
Showing
2 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: codeowners | ||
on: | ||
push: | ||
branches: [main] | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+*" | ||
pull_request_target: | ||
types: | ||
- opened | ||
- synchronize | ||
- edited | ||
- reopened | ||
env: | ||
# Make sure to exit early if cache segment download times out after 2 minutes. | ||
# We limit cache download as a whole to 5 minutes. | ||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 | ||
|
||
# Do not cancel this workflow on main. See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/16616 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
setup-environment: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22.8" | ||
cache: false | ||
- name: Cache Go | ||
id: go-cache | ||
timeout-minutes: 5 | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/go/bin | ||
~/go/pkg/mod | ||
./.tools | ||
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | ||
check-codeowners: | ||
runs-on: ubuntu-latest | ||
needs: [setup-environment] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{github.event.pull_request.head.ref}} | ||
repository: ${{github.event.pull_request.head.repo.full_name}} | ||
path: pr | ||
- name: Gen CODEOWNERS | ||
if: github.repository == 'open-telemetry/opentelemetry-collector-contrib' | ||
run: | | ||
make githubgen-install | ||
cd pr | ||
GITHUB_TOKEN=${{ secrets.READ_ORG_AND_USER_TOKEN }} githubgen | ||
git diff -s --exit-code || (echo 'Generated code is out of date, please apply this diff and commit the changes in this PR.' && git diff && exit 1) |