Skip to content

Commit

Permalink
Merge pull request #34 from ubiquity-os-marketplace/development
Browse files Browse the repository at this point in the history
Merge development into main
  • Loading branch information
gentlementlegen authored Oct 14, 2024
2 parents fa65596 + e7d7382 commit 7e3d649
Show file tree
Hide file tree
Showing 24 changed files with 225,411 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "**/*.http", "**/*.toml", "src/types/database.ts", "supabase/migrations/**", "tests/**"],
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "**/*.http", "**/*.toml", "src/types/database.ts", "supabase/migrations/**", "tests/**", "dist/**"],
"useGitignore": true,
"language": "en",
"words": [
Expand Down
2 changes: 1 addition & 1 deletion .github/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { KnipConfig } from "knip";
const config: KnipConfig = {
entry: ["build/index.ts"],
project: ["src/**/*.ts"],
ignore: ["**/__mocks__/**", "**/__fixtures__/**", "src/types/database.ts"],
ignore: ["**/__mocks__/**", "**/__fixtures__/**", "src/types/database.ts", "dist/**"],
ignoreExportsUsedInFile: true,
// eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "eslint-plugin-filename-rules", "eslint-plugin-sonarjs", "@types/jest", "msw"],
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ on:

jobs:
compute:
permissions: write-all
name: User Activity Watcher
runs-on: ubuntu-latest
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout code
Expand Down
52 changes: 5 additions & 47 deletions .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,17 @@
name: "Update Configuration"
name: "Update Configuration and Build"

on:
workflow_dispatch:
push:

jobs:
update:
name: "Update Configuration in manifest.json"
name: "Update Configuration & Build"
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- name: Install deps and run configuration update
run: |
yarn install --immutable --immutable-cache --check-cache
yarn tsc --noCheck --project tsconfig.json
- name: Update manifest configuration using GitHub Script
uses: actions/github-script@v7
with:
script: |
(async () => {
const fs = await import('fs/promises');
const path = await import('path');
const { pluginSettingsSchema } = await import("${{ github.workspace }}/src/types/plugin-inputs.js");
const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json');
const manifest = JSON.parse(await fs.readFile(manifestPath, 'utf8'));
const configuration = JSON.stringify(pluginSettingsSchema);
manifest["configuration"] = JSON.parse(configuration);
const updatedManifest = JSON.stringify(manifest, null, 2);
console.log('Updated manifest:', updatedManifest);
await fs.writeFile(manifestPath, updatedManifest);
})();
- name: Commit and Push generated types
run: |
git config --global user.name 'ubiquity-os[bot]'
git config --global user.email 'ubiquity-os[bot]@users.noreply.github.com'
git add ./manifest.json
if [ -n "$(git diff-index --cached --name-only HEAD)" ]; then
git commit -m "chore: updated generated configuration" || echo "Lint-staged check failed"
git push origin HEAD:${{ github.ref_name }}
else
echo "No changes to commit"
fi
- uses: ubiquity-os/action-deploy-plugin@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
appId: ${{ secrets.APP_ID }}
appPrivateKey: ${{ secrets.APP_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ cypress/screenshots
.dev.vars
/tests/http/http-client.private.env.json
.wrangler
test-dashboard.md
test-dashboard.md
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @ubiquibot/user-activity-watcher
# @ubiquity-os/daemon-disqualifier

Watches user activity on issues, sends reminders on deadlines, and eventually unassigns inactive user to ensure that
tasks don't stall, and subtracts XP.
Expand Down
24 changes: 15 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
name: "Watch Activity"
description: "Watch user's activity."
inputs:
stateId:
description: "State Id to keep track on the Kernel side"
eventName:
description: "Event Name that triggered the run"
eventPayload:
description: "Event Payload for the plugin"
settings:
description: "Settings for the plugin"
authToken:
description: "Auth Token to auth as the Kernel"
ref:
description: "GitHub branch reference for the run"
outputs:
result:
description: "Actions taken by the watcher."
value: ${{ steps.main.outputs.result }}
runs:
using: "composite"
steps:
- run: |
yarn --cwd ${{ github.action_path }} --production=true
id: install
shell: bash
- run: yarn --cwd ${{ github.action_path }} start
shell: bash
id: main
using: "node20"
main: "dist/index.js"
3 changes: 3 additions & 0 deletions dist/index.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
Loading

0 comments on commit 7e3d649

Please sign in to comment.