From baa20771e763b2a5f2ac2aa6e4cdc471c951765b Mon Sep 17 00:00:00 2001 From: Nicolas Vuillamy Date: Tue, 16 Jul 2024 15:07:25 +0200 Subject: [PATCH] Add GitHub dependents info (#72) * Add GitHub dependents info * MegaLinter config * cspell --- .cspell.json | 92 ++++++++++---------- .github/workflows/github-dependents-info.yml | 70 +++++++++++++++ .mega-linter.yml | 1 + CHANGELOG.md | 1 + README.md | 3 +- 5 files changed, 121 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/github-dependents-info.yml diff --git a/.cspell.json b/.cspell.json index 0a827d6..f6fd404 100644 --- a/.cspell.json +++ b/.cspell.json @@ -1,45 +1,49 @@ { - "ignorePaths": [ - "**/node_modules/**", - "**/vscode-extension/**", - "**/.git/**", - ".vscode", - "megalinter", - "package-lock.json", - "report" - ], - "language": "en", - "version": "0.1", - "words": [ - "GHSA", - "GRYPE", - "MARKDOWNLINT", - "Rapha", - "Rapha\u00ebl", - "Th\u00e9riault", - "Vuillamy", - "aarch", - "adoptium", - "adoptopenjdk", - "dotenv", - "eslintcache", - "fileurl", - "hotspot", - "javaw", - "jscoverage", - "jspm", - "mheiges", - "njre", - "nvuillam", - "openj", - "pids", - "raphaeltheriault", - "riault", - "secretlintrc", - "sparcv", - "stefanzweifel", - "venv", - "vuillamy", - "wscript" - ] -} + "ignorePaths": [ + "**/node_modules/**", + "**/vscode-extension/**", + "**/.git/**", + ".vscode", + "megalinter", + "package-lock.json", + "report" + ], + "language": "en", + "version": "0.1", + "words": [ + "GHSA", + "GRYPE", + "MARKDOWNLINT", + "Rapha", + "Rapha\u00ebl", + "Th\u00e9riault", + "Vuillamy", + "aarch", + "adoptium", + "adoptopenjdk", + "badgemarkdownfile", + "dotenv", + "eslintcache", + "fileurl", + "hotspot", + "javaw", + "jscoverage", + "jspm", + "markdownfile", + "mheiges", + "minstars", + "njre", + "nvuillam", + "openj", + "outputrepo", + "pids", + "raphaeltheriault", + "riault", + "secretlintrc", + "sparcv", + "stefanzweifel", + "venv", + "vuillamy", + "wscript" + ] +} \ No newline at end of file diff --git a/.github/workflows/github-dependents-info.yml b/.github/workflows/github-dependents-info.yml new file mode 100644 index 0000000..b6db752 --- /dev/null +++ b/.github/workflows/github-dependents-info.yml @@ -0,0 +1,70 @@ +# GitHub Dependents Info workflow +# More info at https://github.com/nvuillam/github-dependents-info/ +name: GitHub Dependents Info + +# Let by default +on: + # On manual launch + workflow_dispatch: + # On every push on selected branches (usually just main) + push: + branches: [main,master,setup-gdi] + # Scheduled interval: Use CRON format https://crontab.guru/ + schedule: + - cron: "0 0 * * 0" # Every sunday at midnight + +permissions: read-all + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + build: + name: GitHub Dependents Info + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + # Git Checkout + - name: Checkout Code + uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + # Collect data & generate markdown + - name: GitHub Dependents Info + uses: nvuillam/github-dependents-info@v1.5.1 # If you trust me enough you can replace version by "main" :) + # See documentation for variables details: https://github.com/nvuillam/github-dependents-info?tab=readme-ov-file#%EF%B8%8F-usage + with: + repo: ${{ github.repository }} + outputrepo: ${{ github.repository }} + # markdownfile: docs/github-dependents-info.md + # badgemarkdownfile: README.md + # sort: stars + # minstars: "0" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Workaround for git issues + - name: Prepare commit + run: sudo chown -R $USER:$USER . + + # Create pull request + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} + branch: github-dependents-info-auto-update + commit-message: "[GitHub Dependents Info] Updated markdown file(s)" + delete-branch: true + title: "[GitHub Dependents Info] Updated markdown file" + body: "_Generated with [github-dependents-info](https://github.com/nvuillam/github-dependents-info), by [Nicolas Vuillamy](https://github.com/nvuillam)_" + labels: documentation + - name: Create PR output + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" \ No newline at end of file diff --git a/.mega-linter.yml b/.mega-linter.yml index 9cf3c1c..348df82 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -16,3 +16,4 @@ DISABLE_ERRORS_LINTERS: # DISABLE_ERRORS: true # Uncomment if you want MegaLinter to detect errors but not block CI to pass MARKDOWN_MARKDOWNLINT_FILTER_REGEX_EXCLUDE: (DOCS\.md) YAML_V8R_FILTER_REGEX_EXCLUDE: (appveyor) # Exclude regex for a single linter +ACTION_ACTIONLINT_DISABLE_ERRORS_IF_LESS_THAN: 3 diff --git a/CHANGELOG.md b/CHANGELOG.md index f4541ef..c8137f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] (beta, main branch content) +- Add [github-dependents-info](https://github.com/nvuillam/github-dependents-info) - Add your updates here ! ## [v1.2.2] - 2024-07-16 diff --git a/README.md b/README.md index d4a2495..913d99f 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ # njre ![npm](https://img.shields.io/npm/v/njre.svg) -[![Downloads/week](https://img.shields.io/npm/dw/njre.svg)](https://npmjs.org/package/njre) +[![Downloads/week](https://img.shields.io/npm/dw/njre.svg)](https://npmjs.org/package/njre) [![MegaLinter](https://github.com/nvuillam/njre/workflows/MegaLinter/badge.svg?branch=master)](https://github.com/nvuillam/njre/actions?query=workflow%3AMegaLinter+branch%3Amain) [![GitHub stars](https://img.shields.io/github/stars/nvuillam/njre?cacheSeconds=3600)](https://github.com/nvuillam/njre/stargazers/) [![GitHub contributors](https://img.shields.io/github/contributors/nvuillam/njre.svg)](https://github.com/nvuillam/njre/graphs/contributors/) [![GitHub Sponsors](https://img.shields.io/github/sponsors/nvuillam)](https://github.com/sponsors/nvuillam) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) -![npm bundle size](https://img.shields.io/bundlephobia/minzip/njre.svg) Easily install and use JRE from a Node application.