nuget #9
This file contains 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
name: nuget | |
on: | |
workflow_dispatch: | |
inputs: | |
global: | |
type: choice | |
description: Collect General Stats | |
required: true | |
options: | |
- $true | |
- $false | |
owner: | |
description: Collect Specific Owner Stats | |
schedule: | |
- cron: "0 2 1-7 * 6" | |
jobs: | |
nuget: | |
runs-on: ubuntu-latest | |
steps: | |
- name: π€ defaults | |
uses: devlooped/actions-bot@v1 | |
with: | |
name: ${{ secrets.BOT_NAME }} | |
email: ${{ secrets.BOT_EMAIL }} | |
gh_token: ${{ secrets.GH_TOKEN }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: π€ checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ env.GH_TOKEN }} | |
- name: β sponsors | |
shell: pwsh | |
run: | | |
dotnet tool update -g dotnet-sponsor | |
$owners = gc owners.json | convertfrom-json | |
if ('${{ github.event.inputs.owner }}') { | |
$owners = @('${{ github.event.inputs.owner }}') | |
} | |
foreach ($owner in $owners) { | |
'${{ secrets.DEVLOOPED_TOKEN }}' | sponsor nuget --tos --exceptions --oss-only false --with-token --force --owner $owner | |
} | |
# global stats for all packages | |
if (${{ github.event.inputs.global || '$true' }}) { | |
'${{ secrets.DEVLOOPED_TOKEN }}' | sponsor nuget --tos --exceptions --force --with-token | |
} | |
- name: β¬οΈ commit | |
run: | | |
git add *.json | |
(git commit -m "π Update OSS contributors stats" && git push) || echo "Done" |