-
Notifications
You must be signed in to change notification settings - Fork 3
feat: codeowners-analysis action #1218
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ae044fd
feat: codeowners-analysis action
erikburt 1746039
fix: overall status
erikburt 0c65223
rername to codeowners-review-analysis
erikburt 3a0e6e9
feat: rework processing and displaying
erikburt 9023b12
fix: pull codeowners file from default branch
erikburt 9506ea9
docs: update README
erikburt 94abadb
add changeset
erikburt 25b50df
fix: link formatting
erikburt 8081595
fix: link location
erikburt 2afd133
fix: remove unnecessary method
erikburt cb90b2c
fix: more formatting tweaks
erikburt 76392de
fix: add retry instructions
erikburt 0907d79
Merge branch 'main' into feat/codeowners-analysis
erikburt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
| --- | ||
| "codeowners-review-analysis": minor | ||
| --- | ||
|
|
||
| initial commit |
This file contains hidden or 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,57 @@ | ||
| # Codeowners Analysis | ||
|
|
||
| Analyzes changed files for a given PR, and displays current CODEOWNER | ||
| requirements. | ||
|
|
||
| ## Acknowledgement | ||
|
|
||
| The CODEOWNERS parsing contained in this repo was translated from: | ||
| https://github.com/hmarr/codeowners | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Inputs | ||
|
|
||
| | input | description | default | | ||
| | -------------- | ----------------------------------------------------------------------------- | ------- | | ||
| | `post-comment` | Whether to post a small comment on the PR summarizing codeowners requirements | `true` | | ||
|
|
||
| ### Example Workflow | ||
|
|
||
| ```yaml | ||
| name: Codeowners Analysis Test | ||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths: | ||
| - .github/workflows/codeowners-analysis.yml | ||
| jobs: | ||
| analyze-changes: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read # needed to read codeowners file | ||
| pull-requests: read # needed to comment on PRs | ||
| actions: read # needed to get summary url | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 1 | ||
| - name: Run Codeowners Analysis | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| uses: smartcontractkit/.github/actions/codeowners-review-analysis@<tag> | ||
| ``` | ||
|
|
||
| ## Development | ||
|
|
||
| ### Generated Types | ||
|
|
||
| See [src/generated/README.md](./src/generated/README.md) for more details. | ||
|
|
||
| ### Local Testing | ||
|
|
||
| From the root of the `.github` repository, you can run | ||
| `./actions/codeowners-review-analysis/scripts/test.sh` to run tests. | ||
|
|
||
| - Update both `test.sh` and `payload.json` for your test case |
This file contains hidden or 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,15 @@ | ||
| name: codeowners-review-analysis | ||
| description: | ||
| "Analyzes changed files for a given PR, and displays codeowners required based | ||
| on paths." | ||
|
|
||
| runs: | ||
| using: "node20" | ||
| main: "dist/index.js" | ||
|
|
||
| inputs: | ||
| post-comment: | ||
| description: | ||
| "Whether to post a comment on the PR with the analysis results." | ||
| required: false | ||
| default: "true" | ||
This file contains hidden or 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,8 @@ | ||
| { | ||
| "schema": "./node_modules/@octokit/graphql-schema/schema.graphql", | ||
| "generates": { | ||
| "./src/generated/graphql.ts": { | ||
| "plugins": ["typescript", "typescript-operations"] | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tested anything w/ node24 yet. Will leave this as node20 for now, and maybe we can update most of our actions to node24 in one big swoop.