Skip to content

Commit

Permalink
Add GitHub Dependents Info workflow (#57)
Browse files Browse the repository at this point in the history
* Add GitHub Dependents Info workflow

* Fix ML

* format

* flarf

* format

---------

Co-authored-by: Nicolas Vuillamy <nicolas.vuillamy@cloudity.com>
  • Loading branch information
nvuillam and nvuillam committed Dec 19, 2023
1 parent 73d8890 commit 381d538
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"Perso",
"SIGINT",
"Vuillamy",
"badgemarkdownfile",
"circleci",
"classpath",
"classpaths",
Expand All @@ -33,8 +34,10 @@
"javacaller",
"lcov",
"lycheeignore",
"markdownfile",
"markdownlint",
"megalinter",
"minstars",
"myfolder",
"myjar",
"nawak",
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/github-dependents-info.yml
Original file line number Diff line number Diff line change
@@ -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, 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.3.2
# See documentation for variables details: https://github.com/nvuillam/github-dependents-info?tab=readme-ov-file#%EF%B8%8F-usage
with:
repo: ${{ 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@v5
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 }}"
2 changes: 2 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DISABLE_ERRORS_LINTERS:
- ACTION_ACTIONLINT
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![Version](https://img.shields.io/npm/v/java-caller.svg)](https://www.npmjs.com/package/java-caller)
[![Downloads/week](https://img.shields.io/npm/dw/java-caller.svg)](https://npmjs.org/package/java-caller)
[![Downloads/total](https://img.shields.io/npm/dt/java-caller.svg)](https://npmjs.org/package/java-caller)
[![Downloads/total](https://img.shields.io/npm/dt/java-caller.svg)](https://npmjs.org/package/java-caller)<!-- gh-dependents-info-used-by-start --><!-- gh-dependents-info-used-by-end -->
[![CircleCI](https://circleci.com/gh/nvuillam/node-java-caller/tree/master.svg?style=shield)](https://circleci.com/gh/nvuillam/node-java-caller/tree/master)
[![Mega-Linter](https://github.com/nvuillam/node-java-caller/workflows/Mega-Linter/badge.svg)](https://github.com/nvuillam/mega-linter#readme)
[![codecov](https://codecov.io/gh/nvuillam/node-java-caller/branch/master/graph/badge.svg)](https://codecov.io/gh/nvuillam/node-java-caller)
Expand Down

0 comments on commit 381d538

Please sign in to comment.