diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml new file mode 100644 index 0000000..f82e531 --- /dev/null +++ b/.github/workflows/reports.yml @@ -0,0 +1,47 @@ +name: Generate Report + +on: + schedule: + - cron: 0 0 * * 0 + workflow_dispatch: + +permissions: + pull-requests: write + contents: write + +jobs: + generate_report: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./reports + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + + - name: Run install + run: npm install + + - name: Run generator + run: node --run generate + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create/update pull request + uses: gr2m/create-or-update-pull-request-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + body: > + Here's the new weekly report for the expressjs, jshttp, and pillar.js organizations. + branch: report + commit-message: 'docs: generate weekly report' + title: 'docs: generate weekly report' + assignees: bjohansebas + auto-merge: squash \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..9cf9495 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/README.md b/README.md index efdb931..90615d7 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,32 @@ # tooling -Tooling used in the project. + +Tooling used in the project. Simple scripts without extra fuss to help with the project. Written with less effort and more focus on the task at hand. +## Reports + +This directory contains the weekly triage reports for the Express.js organizations ([expressjs](https://github.com/expressjs), [jshttp](https://github.com/jshttp), [pillarjs](https://github.com/pillarjs)). The goal is to make it easier to see which issues and pull requests were created during the week, and to help with triage efforts within the organization. + +You can find the reports in the `reports` directory + ## Scripts -### `owner/create-label.mjs` - Create Label -Allows you to create a label in all existing repositories in an organization. -### `triage/subscribe-to-org-repos.js` - Subscribe to Org Repos +### `scripts/owner/create-label.mjs` - Create Label + +Allows you to create a label in all existing repositories in an organization. + +### `scripts/triage/subscribe-to-org-repos.js` - Subscribe to Org Repos + Allows you to subscribe to all repositories in an organization. -## Usage +### Usage + 1. Clone the repository 2. Install the required dependency for the script you want to use 3. Make necessary changes to the script 4. Run the script -## Note -- Your GitHub token should have the necessary permissions to perform the actions. - +### Note +- Your GitHub token should have the necessary permissions to perform the actions. diff --git a/package.json b/package.json new file mode 100644 index 0000000..3dc3762 --- /dev/null +++ b/package.json @@ -0,0 +1,7 @@ +{ + "name": "tooling", + "private": true, + "workspaces": [ + "reports" + ] +} \ No newline at end of file diff --git a/reports/expressjs/.gitkeep b/reports/expressjs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/reports/generate.js b/reports/generate.js new file mode 100644 index 0000000..c75c371 --- /dev/null +++ b/reports/generate.js @@ -0,0 +1,19 @@ +import { writeFile } from "node:fs/promises"; +import { resolve } from "node:path"; +import generate from "@retrogen/generate"; +import { DateTime } from "luxon"; + +for await (const organization of ["expressjs", "pillarjs", "jshttp"]) { + const now = DateTime.now(); + const then = now.minus({ days: 7 }); + + const dates = { + start: then.toISODate(), + end: now.toISODate(), + }; + + const report = await generate(organization, dates); + + // write the data out to a file + await writeFile(resolve(`./${organization}/${dates.start}.md`), report); +} \ No newline at end of file diff --git a/reports/jshttp/.gitkeep b/reports/jshttp/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/reports/package.json b/reports/package.json new file mode 100644 index 0000000..66f5cc5 --- /dev/null +++ b/reports/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "type": "module", + "scripts": { + "lint": "biome check", + "lint:fix": "biome check --fix", + "generate": "node generate.js" + }, + "license": "MIT", + "dependencies": { + "@retrogen/generate": "^0.0.2", + "luxon": "^2.3.2" + }, + "devDependencies": { + "@biomejs/biome": "1.9.4" + } +} \ No newline at end of file diff --git a/reports/pillarjs/.gitkeep b/reports/pillarjs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/owner/create-label.mjs b/scripts/owner/create-label.mjs similarity index 100% rename from owner/create-label.mjs rename to scripts/owner/create-label.mjs diff --git a/triage/subscribe-to-org-repos.js b/scripts/triage/subscribe-to-org-repos.js similarity index 100% rename from triage/subscribe-to-org-repos.js rename to scripts/triage/subscribe-to-org-repos.js