From fb2e7c90da743ce70f8fc0cc15a67c6d9e652daa Mon Sep 17 00:00:00 2001 From: jmeridth Date: Mon, 19 Aug 2024 07:44:28 -0500 Subject: [PATCH] fix: run prettier on all files suggested by new version of super-linter Signed-off-by: jmeridth --- .github/linters/.jscpd.json | 10 +- .github/pull_request_template.md | 4 +- .github/release-drafter.yml | 80 ++++---- .github/workflows/auto-labeler.yml | 2 +- .github/workflows/docker-image.yml | 4 +- .github/workflows/linter.yaml | 2 +- .github/workflows/major-version-updater.yml | 2 +- .github/workflows/pr-title.yml | 2 +- .github/workflows/python-package.yml | 4 +- .github/workflows/release.yml | 4 +- .github/workflows/scorecard.yml | 4 +- .github/workflows/stale.yaml | 8 +- .github/workflows/use-action.yml | 4 +- .vscode/settings.json | 10 +- CONTRIBUTING.md | 9 +- README.md | 195 ++++++++++---------- action.yml | 14 +- 17 files changed, 181 insertions(+), 177 deletions(-) diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json index 87412a7..b67b860 100644 --- a/.github/linters/.jscpd.json +++ b/.github/linters/.jscpd.json @@ -1,7 +1,5 @@ { - "threshold": 25, - "ignore": [ - "test*" - ], - "absolute": true -} \ No newline at end of file + "threshold": 25, + "ignore": ["test*"], + "absolute": true +} diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2a36620..f78f37f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,5 +1,6 @@ # Pull Request - ## Proposed Changes + ## Readiness Checklist diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 298c48b..679e7e8 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,6 +1,6 @@ --- -name-template: 'v$RESOLVED_VERSION' -tag-template: 'v$RESOLVED_VERSION' +name-template: "v$RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" template: | # Changelog $CHANGES @@ -8,61 +8,61 @@ template: | See details of [all code changes](https://github.com/github/stale-repos/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release categories: - - title: '🚀 Features' + - title: "🚀 Features" labels: - - 'feature' - - 'enhancement' - - title: '🐛 Bug Fixes' + - "feature" + - "enhancement" + - title: "🐛 Bug Fixes" labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: '🧰 Maintenance' + - "fix" + - "bugfix" + - "bug" + - title: "🧰 Maintenance" labels: - - 'infrastructure' - - 'automation' - - 'documentation' - - 'dependencies' - - 'maintenance' - - 'revert' - - title: '🏎 Performance' - label: 'performance' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' + - "infrastructure" + - "automation" + - "documentation" + - "dependencies" + - "maintenance" + - "revert" + - title: "🏎 Performance" + label: "performance" +change-template: "- $TITLE @$AUTHOR (#$NUMBER)" version-resolver: major: labels: - - 'breaking' + - "breaking" minor: labels: - - 'enhancement' - - 'fix' + - "enhancement" + - "fix" patch: labels: - - 'documentation' - - 'maintenance' + - "documentation" + - "maintenance" default: patch autolabeler: - - label: 'automation' + - label: "automation" title: - - '/^(build|ci|perf|refactor|test).*/i' - - label: 'enhancement' + - "/^(build|ci|perf|refactor|test).*/i" + - label: "enhancement" title: - - '/^(style).*/i' - - label: 'documentation' + - "/^(style).*/i" + - label: "documentation" title: - - '/^(docs).*/i' - - label: 'feature' + - "/^(docs).*/i" + - label: "feature" title: - - '/^(feat).*/i' - - label: 'fix' + - "/^(feat).*/i" + - label: "fix" title: - - '/^(fix).*/i' - - label: 'infrastructure' + - "/^(fix).*/i" + - label: "infrastructure" title: - - '/^(infrastructure).*/i' - - label: 'maintenance' + - "/^(infrastructure).*/i" + - label: "maintenance" title: - - '/^(chore|maintenance).*/i' - - label: 'revert' + - "/^(chore|maintenance).*/i" + - label: "revert" title: - - '/^(revert).*/i' + - "/^(revert).*/i" diff --git a/.github/workflows/auto-labeler.yml b/.github/workflows/auto-labeler.yml index 7ee1928..9fe305e 100644 --- a/.github/workflows/auto-labeler.yml +++ b/.github/workflows/auto-labeler.yml @@ -4,7 +4,7 @@ name: Auto Labeler on: # pull_request_target event is required for autolabeler to support all PRs including forks pull_request_target: - types: [ opened, reopened, edited, synchronize ] + types: [opened, reopened, edited, synchronize] permissions: contents: read diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b3a7cee..e908859 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,9 +3,9 @@ name: Docker Image CI on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] permissions: contents: read diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 8086db0..9a918d6 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -3,7 +3,7 @@ name: Lint Code Base on: pull_request: - branches: [ main ] + branches: [main] permissions: contents: read diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml index 6eb61eb..6e05005 100644 --- a/.github/workflows/major-version-updater.yml +++ b/.github/workflows/major-version-updater.yml @@ -3,7 +3,7 @@ name: Major Version Updater # Whenever a new release is made, push a major version tag on: release: - types: [ published ] + types: [published] permissions: contents: read diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 0172fff..08a6625 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -4,7 +4,7 @@ name: "Lint PR Title" on: pull_request_target: - types: [ opened, reopened, edited, synchronize ] + types: [opened, reopened, edited, synchronize] permissions: contents: read diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 964d61a..c70a624 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -5,9 +5,9 @@ name: Python package on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] permissions: contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef70622..68b29b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,8 +4,8 @@ name: Release on: workflow_dispatch: pull_request_target: - types: [ closed ] - branches: [ main ] + types: [closed] + branches: [main] permissions: contents: read diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 5b4f39d..b4669ef 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -9,9 +9,9 @@ on: # To guarantee Maintained check is occasionally updated. See # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained schedule: - - cron: '29 11 * * 6' + - cron: "29 11 * * 6" push: - branches: [ main ] + branches: [main] permissions: read-all diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 5a0bc41..9448521 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -1,7 +1,7 @@ -name: 'Close stale issues' +name: "Close stale issues" on: schedule: - - cron: '30 1 * * *' + - cron: "30 1 * * *" permissions: issues: write @@ -13,8 +13,8 @@ jobs: steps: - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e with: - stale-issue-message: 'This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.' - close-issue-message: 'This issue was closed because it has been stalled for 35 days with no activity.' + stale-issue-message: "This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days." + close-issue-message: "This issue was closed because it has been stalled for 35 days with no activity." days-before-stale: 21 days-before-close: 14 days-before-pr-close: -1 diff --git a/.github/workflows/use-action.yml b/.github/workflows/use-action.yml index 75b3311..f59d06d 100644 --- a/.github/workflows/use-action.yml +++ b/.github/workflows/use-action.yml @@ -3,10 +3,10 @@ name: stale repo identifier on: workflow_dispatch: push: - branches: [ main ] + branches: [main] pull_request: schedule: - - cron: '3 2 1 * *' + - cron: "3 2 1 * *" permissions: contents: read jobs: diff --git a/.vscode/settings.json b/.vscode/settings.json index 3e99ede..6d8c9f6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,5 @@ { - "python.testing.pytestArgs": [ - "." - ], - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true -} \ No newline at end of file + "python.testing.pytestArgs": ["."], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f807109..3d46fc2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,6 @@ + # Contributing to stale repos First off, thanks for taking the time to contribute! :heart: @@ -7,6 +8,7 @@ First off, thanks for taking the time to contribute! :heart: All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us project owners and smooth out the experience for all involved. The team looks forward to your contributions. :tada: + ## Table of Contents - [I Have a Question](#i-have-a-question) @@ -30,11 +32,13 @@ We will then take care of the issue as soon as possible. ## I Want To Contribute > ### Legal Notice +> > When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. ## Reporting Bugs + ### Before Submitting a Bug Report A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. @@ -50,6 +54,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform - Can you reliably reproduce the issue? And can you also reproduce it with older versions? + ### How Do I Submit a Good Bug Report? Please submit a bug report using our [GitHub Issues template](https://github.com/github/stale-repos/issues/new?template=bug_report.yml). @@ -59,6 +64,7 @@ Please submit a bug report using our [GitHub Issues template](https://github.com This section guides you through submitting an enhancement suggestion for stale_repos, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. + ### Before Submitting an Enhancement - Make sure that you are using the latest version. @@ -67,6 +73,7 @@ This section guides you through submitting an enhancement suggestion for stale_r - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature or to develop the feature yourself and contribute it to the project. + ### How Do I Submit a Good Enhancement Suggestion? Please submit an enhancement suggestion using our [GitHub Issues template](https://github.com/github/stale-repos/issues/new?template=feature_request.yml). @@ -79,4 +86,4 @@ We are using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0. Releases are automated if a pull request is labelled with our [SemVer related labels](.github/release-drafter.yml) or with the `vuln` or `release` labels. -You can also manually initiate a release you can do so through the GitHub Actions UI. If you have permissions to do so, you can navigate to the [Actions tab](https://github.com/github/stale-repos/actions/workflows/release.yml) and select the `Run workflow` button. This will allow you to select the branch to release from and the version to release. +You can also manually initiate a release you can do so through the GitHub Actions UI. If you have permissions to do so, you can navigate to the [Actions tab](https://github.com/github/stale-repos/actions/workflows/release.yml) and select the `Run workflow` button. This will allow you to select the branch to release from and the version to release. diff --git a/README.md b/README.md index 535c2de..2aa2bf3 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ All feedback regarding our GitHub Actions, as a whole, should be communicated th 1. Create a repository to host this GitHub Action or select an existing repository. 1. Create the env values from the sample workflow below (GH_TOKEN, ORGANIZATION, EXEMPT_TOPICS) with your information as plain text or repository secrets. More info on creating secrets can be found [here](https://docs.github.com/en/actions/security-guides/encrypted-secrets). -Note: Your GitHub token will need to have read access to all the repositories in the organization that you want evaluated + Note: Your GitHub token will need to have read access to all the repositories in the organization that you want evaluated 1. Copy the below example workflow to your repository and put it in the `.github/workflows/` directory with the file extension `.yml` (ie. `.github/workflows/stale_repos.yml`) ### Configuration @@ -45,29 +45,29 @@ This action can be configured to authenticate with GitHub App Installation or Pe ##### GitHub App Installation -| field | required | default | description | -|-------------------------------|----------|---------|-------------| -| `GH_APP_ID` | True | `""` | GitHub Application ID. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. | -| `GH_APP_INSTALLATION_ID` | True | `""` | GitHub Application Installation ID. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. | -| `GH_APP_PRIVATE_KEY` | True | `""` | GitHub Application Private Key. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. | +| field | required | default | description | +| ------------------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `GH_APP_ID` | True | `""` | GitHub Application ID. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. | +| `GH_APP_INSTALLATION_ID` | True | `""` | GitHub Application Installation ID. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. | +| `GH_APP_PRIVATE_KEY` | True | `""` | GitHub Application Private Key. See [documentation](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) for more details. | ##### Personal Access Token (PAT) -| field | required | default | description | -|-------------------------------|----------|---------|-------------| -| `GH_TOKEN` | True | `""` | The GitHub Token used to scan the repository. Must have read access to all repository you are interested in scanning. | +| field | required | default | description | +| ---------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------- | +| `GH_TOKEN` | True | `""` | The GitHub Token used to scan the repository. Must have read access to all repository you are interested in scanning. | #### Other Configuration Options -| field | required | default | description | -|---------------------------|----------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `ACTIVITY_METHOD` | false | `"pushed"` | How to get the last active date of the repository. Defaults to `pushed`, which is the last time any branch had a push. Can also be set to `default_branch_updated` to instead measure from the latest commit on the default branch (good for filtering out dependabot ) | -| `GH_ENTERPRISE_URL` | false | `""` | URL of GitHub Enterprise instance to use for auth instead of github.com | -| `INACTIVE_DAYS` | true | | The number of days used to determine if repository is stale, based on `push` events | -| `EXEMPT_REPOS` | false | | Comma separated list of repositories to exempt from being flagged as stale. Supports Unix shell-style wildcards. ie. `EXEMPT_REPOS = "stale-repos,test-repo,conf-*"` | -| `EXEMPT_TOPICS` | false | | Comma separated list of topics to exempt from being flagged as stale | -| `ORGANIZATION` | false | | The organization to scan for stale repositories. If no organization is provided, this tool will search through repositories owned by the GH_TOKEN owner | -| `ADDITIONAL_METRICS` | false | | Configure additional metrics like days since last release or days since last pull request. This allows for more detailed reporting on repository activity. To include both metrics, set `ADDITIONAL_METRICS: "release,pr"` | +| field | required | default | description | +| -------------------- | -------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ACTIVITY_METHOD` | false | `"pushed"` | How to get the last active date of the repository. Defaults to `pushed`, which is the last time any branch had a push. Can also be set to `default_branch_updated` to instead measure from the latest commit on the default branch (good for filtering out dependabot ) | +| `GH_ENTERPRISE_URL` | false | `""` | URL of GitHub Enterprise instance to use for auth instead of github.com | +| `INACTIVE_DAYS` | true | | The number of days used to determine if repository is stale, based on `push` events | +| `EXEMPT_REPOS` | false | | Comma separated list of repositories to exempt from being flagged as stale. Supports Unix shell-style wildcards. ie. `EXEMPT_REPOS = "stale-repos,test-repo,conf-*"` | +| `EXEMPT_TOPICS` | false | | Comma separated list of topics to exempt from being flagged as stale | +| `ORGANIZATION` | false | | The organization to scan for stale repositories. If no organization is provided, this tool will search through repositories owned by the GH_TOKEN owner | +| `ADDITIONAL_METRICS` | false | | Configure additional metrics like days since last release or days since last pull request. This allows for more detailed reporting on repository activity. To include both metrics, set `ADDITIONAL_METRICS: "release,pr"` | ### Example workflow @@ -77,10 +77,10 @@ name: stale repo identifier on: workflow_dispatch: schedule: - - cron: '3 2 1 * *' + - cron: "3 2 1 * *" permissions: - contents: read + contents: read jobs: build: @@ -92,35 +92,34 @@ jobs: issues: write steps: - - uses: actions/checkout@v3 - - - name: Run stale_repos tool - uses: github/stale-repos@v1 - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - ORGANIZATION: ${{ secrets.ORGANIZATION }} - EXEMPT_TOPICS: "keep,template" - INACTIVE_DAYS: 365 - ACTIVITY_METHOD: "pushed" - ADDITIONAL_METRICS: "release,pr" - - # This next step updates an existing issue. If you want a new issue every time, remove this step and remove the `issue-number: ${{ env.issue_number }}` line below. - - name: Check for the stale report issue - run: | - ISSUE_NUMBER=$(gh search issues "Stale repository report" --match title --json number --jq ".[0].number") - echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_ENV" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Create issue - uses: peter-evans/create-issue-from-file@v5 - with: - issue-number: ${{ env.issue_number }} - title: Stale repository report - content-filepath: ./stale_repos.md - assignees: - token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v3 + - name: Run stale_repos tool + uses: github/stale-repos@v1 + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + ORGANIZATION: ${{ secrets.ORGANIZATION }} + EXEMPT_TOPICS: "keep,template" + INACTIVE_DAYS: 365 + ACTIVITY_METHOD: "pushed" + ADDITIONAL_METRICS: "release,pr" + + # This next step updates an existing issue. If you want a new issue every time, remove this step and remove the `issue-number: ${{ env.issue_number }}` line below. + - name: Check for the stale report issue + run: | + ISSUE_NUMBER=$(gh search issues "Stale repository report" --match title --json number --jq ".[0].number") + echo "issue_number=$ISSUE_NUMBER" >> "$GITHUB_ENV" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create issue + uses: peter-evans/create-issue-from-file@v5 + with: + issue-number: ${{ env.issue_number }} + title: Stale repository report + content-filepath: ./stale_repos.md + assignees: + token: ${{ secrets.GITHUB_TOKEN }} ``` ### Example stale_repos.md output @@ -130,9 +129,9 @@ jobs: The following repos have not had a push event for more than 3 days: -| Repository URL | Days Inactive | Last Push Date | Visibility | Days Since Last Release | Days Since Last PR | -| --- | ---: | ---: | ---: | ---: | ---: | -| https://github.com/github/.github | 5 | 2020-1-30 | private | 10 | 7 | +| Repository URL | Days Inactive | Last Push Date | Visibility | Days Since Last Release | Days Since Last PR | +| --------------------------------- | ------------: | -------------: | ---------: | ----------------------: | -----------------: | +| https://github.com/github/.github | 5 | 2020-1-30 | private | 10 | 7 | ``` ### Using JSON instead of Markdown @@ -147,10 +146,10 @@ name: stale repo identifier on: workflow_dispatch: schedule: - - cron: '3 2 1 * *' + - cron: "3 2 1 * *" permissions: - contents: read + contents: read jobs: build: @@ -158,33 +157,33 @@ jobs: runs-on: ubuntu-latest steps: - - name: Run stale_repos tool - id: stale-repos - uses: github/stale-repos@v1 - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - ORGANIZATION: ${{ secrets.ORGANIZATION }} - EXEMPT_TOPICS: "keep,template" - INACTIVE_DAYS: 365 - ADDITIONAL_METRICS: "release,pr" - - - name: Print output of stale_repos tool - run: echo "${{ steps.stale-repos.outputs.inactiveRepos }}" - - uses: actions/github-script@v6 - with: - script: | - const repos = ${{ steps.stale-repos.outputs.inactiveRepos }} - for (const repo of repos) { - console.log(repo); - const issue = await github.rest.issues.create({ - owner: , - repo: , - title: 'Stale repo' + repo.url, - body: 'This repo is stale. Please contact the owner to make it active again.', - }); - console.log(issue); - } - github-token: ${{ secrets.GH_TOKEN }} + - name: Run stale_repos tool + id: stale-repos + uses: github/stale-repos@v1 + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + ORGANIZATION: ${{ secrets.ORGANIZATION }} + EXEMPT_TOPICS: "keep,template" + INACTIVE_DAYS: 365 + ADDITIONAL_METRICS: "release,pr" + + - name: Print output of stale_repos tool + run: echo "${{ steps.stale-repos.outputs.inactiveRepos }}" + - uses: actions/github-script@v6 + with: + script: | + const repos = ${{ steps.stale-repos.outputs.inactiveRepos }} + for (const repo of repos) { + console.log(repo); + const issue = await github.rest.issues.create({ + owner: , + repo: , + title: 'Stale repo' + repo.url, + body: 'This repo is stale. Please contact the owner to make it active again.', + }); + console.log(issue); + } + github-token: ${{ secrets.GH_TOKEN }} ``` ### Running against multiple organizations? @@ -194,13 +193,13 @@ You can utilize the GitHub Actions Matrix Strategy as shown below to run against ```yaml on: - workflow_dispatch - + name: Run the report permissions: - contents: read + contents: read -jobs: +jobs: report: name: run report runs-on: ubuntu-latest @@ -228,7 +227,7 @@ on: name: Run the report permissions: - contents: read + contents: read jobs: build: @@ -236,19 +235,19 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Run stale_repos tool - uses: github/stale-repos@v1 - env: - GH_APP_ID: ${{ secrets.GH_APP_ID }} - GH_APP_INSTALLATION_ID: ${{ secrets.GH_APP_INSTALLATION_ID }} - GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }} - ORGANIZATION: ${{ secrets.ORGANIZATION }} - EXEMPT_TOPICS: "keep,template" - INACTIVE_DAYS: 365 - ACTIVITY_METHOD: "pushed" - ADDITIONAL_METRICS: "release,pr" + - uses: actions/checkout@v3 + + - name: Run stale_repos tool + uses: github/stale-repos@v1 + env: + GH_APP_ID: ${{ secrets.GH_APP_ID }} + GH_APP_INSTALLATION_ID: ${{ secrets.GH_APP_INSTALLATION_ID }} + GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }} + ORGANIZATION: ${{ secrets.ORGANIZATION }} + EXEMPT_TOPICS: "keep,template" + INACTIVE_DAYS: 365 + ACTIVITY_METHOD: "pushed" + ADDITIONAL_METRICS: "release,pr" ``` ## Local usage without Docker @@ -259,7 +258,7 @@ jobs: 1. Fill out the `.env` file with the desired _inactive_days_ value. This should be a whole positive number representing the amount of inactivity that you want for flagging stale repos. 1. (Optional) Fill out the `.env` file with the [repository topics](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics) _exempt_topics_ that you want to filter out from the stale repos report. This should be a comma separated list of topics. 1. (Optional) Fill out the `.env` file with the exact _organization_ that you want to search in -1. (Optional) Fill out the `.env` file with the exact _URL_ of the GitHub Enterprise that you want to search in. Keep empty if you want to search in the public `github.com`. +1. (Optional) Fill out the `.env` file with the exact _URL_ of the GitHub Enterprise that you want to search in. Keep empty if you want to search in the public `github.com`. 1. `pip install -r requirements.txt` 1. Run `python3 ./stale_repos.py`, which will output a list of repositories and the length of their inactivity diff --git a/action.yml b/action.yml index af83c71..db1e659 100644 --- a/action.yml +++ b/action.yml @@ -1,13 +1,13 @@ --- -name: 'stale-repos' -author: 'github' -description: 'A GitHub Action to identify stale repos within an organization' +name: "stale-repos" +author: "github" +description: "A GitHub Action to identify stale repos within an organization" outputs: inactiveRepos: description: "Inactive Repos in the organization" runs: - using: 'docker' - image: 'docker://ghcr.io/github/stale_repos:v1' + using: "docker" + image: "docker://ghcr.io/github/stale_repos:v1" branding: - icon: 'check-square' - color: 'white' + icon: "check-square" + color: "white"