Skip to content

Commit

Permalink
Edit PR title/body, add $lib/data folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Dec 17, 2023
1 parent 7745107 commit b57775e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/actions/update-stars/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ async function main() {
0
)} stars)`
);
writeFileSync('src/lib/stars.json', JSON.stringify({ github, gitlab }));
writeFileSync('src/lib/data/stars.json', JSON.stringify({ github, gitlab }));
}

try {
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/fetch-latest-data.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Fetch latest data
name: Update data

on:
schedule:
Expand Down Expand Up @@ -30,10 +30,10 @@ jobs:
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "(AUTO) Update stars"
title: "🤖 Update stars"
body: Update all stars count from Github and Gitlab
branch: ci-update-stars
add-paths: src/lib/stars.json
commit-message: "(AUTO) Update data"
title: "🤖 Update data"
body: Automatically fetch latest data from NPM, GitHub and GitLab
branch: ci-update-data
add-paths: src/lib/data/npm.json,src/lib/data/stars.json
delete-branch: true
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion scripts/updateNpm.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const npm = await Promise.all(
return values.reduce((result, value) => Object.assign(result, value), {});
});

writeFileSync('src/lib/npm.json', JSON.stringify(npm));
writeFileSync('src/lib/data/npm.json', JSON.stringify(npm));

/** @param {ReturnType<typeof data>[0]} pkg */
async function processPackage(pkg) {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib/utils/injectNpmData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import npm from '$lib/npm.json';
import npm from '$lib/data/npm.json';
import type { z } from 'zod';
import type { componentsSchema } from '$lib/schemas';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/stars.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import stars from '$lib/stars.json';
import stars from '$lib/data/stars.json';

type RepoInfo = {
type: 'Github' | 'Gitlab';
Expand Down

0 comments on commit b57775e

Please sign in to comment.