Skip to content

Commit

Permalink
Merge pull request #28 from gentlementlegen/fix/contributor-approvals
Browse files Browse the repository at this point in the history
fix: contributor approvals
  • Loading branch information
gentlementlegen authored Nov 25, 2024
2 parents 4001255 + c37c2ea commit 4eae211
Show file tree
Hide file tree
Showing 23 changed files with 32,683 additions and 6,410 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", "./src/adapters/supabase/**/**.ts", "eslint.config.mjs"],
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts", "eslint.config.mjs", "dist"],
"useGitignore": true,
"language": "en",
"words": ["Nektos", "dataurl", "devpool", "outdir", "servedir", "Supabase", "SUPABASE", "typebox", "ubiquibot", "Smee", "typeorm", "timespan", "mswjs"],
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ jobs:
steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache

- run: ${{ toJSON(inputs) }}
shell: cat {0}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ubiquity/action-conventional-commits@master
9 changes: 3 additions & 6 deletions .github/workflows/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.10.0"
- uses: oven-sh/setup-bun@v2

- name: Install cspell
run: yarn add cspell
run: bun add cspell

- name: Run cspell
run: yarn format:cspell
run: bun run format:cspell
6 changes: 2 additions & 4 deletions .github/workflows/jest-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ jobs:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: "20.10.0"
- uses: oven-sh/setup-bun@v2

- uses: actions/checkout@master
with:
fetch-depth: 0

- name: Jest With Coverage
run: yarn install --immutable --immutable-cache --check-cache && yarn test
run: bun install --frozen-lockfile && bun run test

- name: Add Jest Report to Summary
if: always()
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.10.0
- uses: oven-sh/setup-bun@v2

- name: Install toolchain
run: yarn install
run: bun install --frozen-lockfile

- name: Store PR number
run: echo ${{ github.event.number }} > pr-number.txt

- name: Run Knip
run: yarn knip || yarn knip --reporter json > knip-results.json
run: bun run knip || bun run knip --reporter json > knip-results.json

- name: Upload knip result
if: failure()
Expand Down
53 changes: 8 additions & 45 deletions .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,21 @@
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
- uses: ubiquity-os/action-deploy-plugin@main
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: |
const fs = require('fs');
const path = require('path');
const { pluginSettingsSchema } = require('./src/types');
const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json');
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
const configuration = JSON.stringify(pluginSettingsSchema);
manifest["configuration"] = JSON.parse(configuration);
const updatedManifest = JSON.stringify(manifest, null, 2)
console.log('Updated manifest:', updatedManifest);
fs.writeFileSync(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
treatAsEsm: true
sourcemap: false
pluginEntry: '${{ github.workspace }}/src/action.ts'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit "$1"
bun commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
bun lint-staged
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ on the association of the pull-request author.
## Testing
```shell
yarn test
bun test
```
11 changes: 2 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,5 @@ outputs:
description: "Conditionally merge pull requests after a timeout."
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"
Binary file added bun.lockb
Binary file not shown.
Loading

0 comments on commit 4eae211

Please sign in to comment.