Skip to content

Commit

Permalink
Feature: Made charts optional (#48)
Browse files Browse the repository at this point in the history
* Feature: Added anonymous tracking

* Feature: Replace Total merge in reviews table with total reviews conducted

* Feature: Added events and use_charts variable

* Feature: Added percentage in table

* Feature: Added sorting

* Feature: Update readme

* Feature: Update readme
  • Loading branch information
AlexSim93 authored Oct 29, 2024
1 parent 2e2aec1 commit 6b15a1d
Show file tree
Hide file tree
Showing 14 changed files with 358 additions and 93 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,19 @@ To integrate **pull-request-analytics-action** into your GitHub repository, use
runs-on: ubuntu-latest
steps:
- name: "Run script for analytics"
uses: AlexSim93/pull-request-analytics-action@v3
uses: AlexSim93/pull-request-analytics-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # In the case of a personal access token, it needs to be added to the repository's secrets and used in this field.
GITHUB_REPO_FOR_ISSUE: "repo" # Make sure to specify the name of the repository where the issue will be created
GITHUB_OWNER_FOR_ISSUE: "owner" # Make sure to specify the owner of the repository where the issue will be created
GITHUB_OWNERS_REPOS: "owner/repo" # Be sure to list the owner and repository name in the format owner/repo
GITHUB_REPO_FOR_ISSUE: # Make sure to specify the name of the repository where the issue will be created
GITHUB_OWNER_FOR_ISSUE: # Make sure to specify the owner of the repository where the issue will be created
GITHUB_OWNERS_REPOS: # Be sure to list the owner and repository name in the format owner/repo
CORE_HOURS_START: "9:00"
CORE_HOURS_END: "19:00"
TIMEZONE: "Europe/Berlin"
REPORT_DATE_START: ${{ inputs.report_date_start }}
REPORT_DATE_END: ${{ inputs.report_date_end }}
```
4. Check your repository settings if you want to publish reports in issues. Go to the repository's **Settings**, and under the **Features** section, make sure the **Issues** checkbox is selected. Additionally, if you are collecting statistics for an organization's repository using a **personal access token**, ensure that the token has the necessary permissions. To do this, go to the organization's **Settings** and navigate to the **Personal access token** tab. Verify that the tokens (classic) have permission to access the repository.
5. Decide on which GitHub event you want to trigger the report generation. You can refer to the [GitHub Events Documentation](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) for a detailed understanding of different events. In this example, the `workflow_dispatch` event is selected to allow the action to be manually triggered multiple times with different parameters. `report_date_start` and `report_date_end` can be set before running the action without modifying the code.
6. Depending on your needs, you can use either the `GITHUB_TOKEN` or a generated **Personal Access Token (classic)**. In this example, we are using the `GITHUB_TOKEN`, but keep in mind that it won't allow you to collect data from multiple repositories or organizations, nor will it provide data segmented by GitHub teams. If these features are critical for you, create a token with the **repo** and **read:org** scopes selected on [tokens page](https://github.com/settings/tokens). You can read more about tokens in the [GitHub Documentation](https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api?apiVersion=2022-11-28).
Expand Down Expand Up @@ -238,13 +239,14 @@ Below is a table outlining the various configuration parameters available for **
| `ISSUE_TITLE` | Title for the created/updated issue with report | `Pull requests report(d/MM/yyyy HH:mm)` |
| `LABELS` | Labels for the created/updated issue with report separated by commas. Example: `Report` | - |
| `ASSIGNEES` | Assignees for the created/updated issue with report separated by commas. Example: `AlexSim93` | - |
| `USE_CHARTS` | Primarily uses charts and diagrams instead of tables to display data. Set the value to `true` to use charts instead of tables | `false` |
| `HIDE_USERS` | Hides selected users from reports, while still including their data in the analytics. Use `total` to hide total stats. Users should be separated by commas. | - |
| `SHOW_USERS` | Displays only specified users in reports, but includes all users in the background analytics. Use `total` to show total stats. Users should be separated by commas. | - |
| `EXCLUDE_LABELS` | PRs with mentioned labels will be excluded from the report . Values should be separated by commas. Example: `bugfix, enhancement` | - |
| `INCLUDE_LABELS` | Only PRs with mentioned labels will be included in the report. Values should be separated by commas. Example: `bugfix, enhancement` | - |
| `EXECUTION_OUTCOME` | This parameter allows you to specify the format in which you wish to receive the report. Options include creating a new issue, updating an existing one, obtaining markdown, or JSON. Markdown and JSON will be available in outputs. Can take mulitple values separated by commas: `new-issue`, `markdown`, `collection`, `existing-issue`. This parameter is **required** Example: `existing-issue` | `new-issue` |
| `ISSUE_NUMBER` | Issue number to update. Add `existing-issue` to `EXECUTION_OUTCOME` for updating existing issue. The specified issue must already exist at the time the action is executed. This parameter is mandatory if the `EXECUTION_OUTCOME` input includes `existing-issue` value | - |
| `ALLOW_ANALYTICS` | Allows sending non-sensitive inputs to mixpanel for better understanding user's needs. Set the value to `false` to disable data transmission to Mixpanel | `true` |
| `ALLOW_ANALYTICS` | Allows sending non-sensitive inputs to mixpanel for better understanding user's needs. Set the value to `false` to disable sending action parameter data | `true` |

Use these parameters to tailor the **pull-request-analytics-action** to your project's specific requirements.

Expand All @@ -267,6 +269,7 @@ Below is a table describing the possible outputs of **pull-request-analytics-act
- You can filter pull requests using labels with the `EXCLUDE_LABELS` and `INCLUDE_LABELS` parameters.

## Troubleshooting

If you encounter a `Not Found` error:

- Check the scopes of your **personal access token** if you're using one.
Expand All @@ -278,7 +281,7 @@ You can read more about this in the [GitHub documentation](https://docs.github.c

## Privacy and Data Handling

**pull-request-analytics-action** is stateless; it does not send or store any of the collected data. However, to better understand user needs, fix bugs, and efficiently develop the project, some non-sensitive input parameters are sent to Mixpanel. These data are anonymous and do not provide any information that could identify the project or its data. If you wish to disable any data transmission, set `ALLOW_ANALYTICS` to `false`.
**pull-request-analytics-action** is stateless; it does not send or store any of the collected data. However, to better understand user needs, fix bugs, and efficiently develop the project, some non-sensitive input parameters are sent to Mixpanel. These data are anonymous and do not provide any information that could identify the project or its data. If you wish to disable parameter data transmission, set `ALLOW_ANALYTICS` to `false`.

## Usage Limitations

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ inputs:
description: "Allows sending non-sensitive inputs to mixpanel"
required: false
default: true
USE_CHARTS:
descriptions: "Primarily uses charts and diagrams instead of tables to display data"
required: false
default: false

outputs:
JSON_COLLECTION:
Expand Down
Loading

0 comments on commit 6b15a1d

Please sign in to comment.