Skip to content

Commit

Permalink
Edit verification submission action
Browse files Browse the repository at this point in the history
  • Loading branch information
nthouliss committed Sep 20, 2023
1 parent 3e52c1f commit 482df2f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/submit-verification-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ jobs:
if: contains(github.event.comment.body, '/verify')
with:
node-version: 16
- uses: actions/github-script@v6
id: process-comment
with:
script: |
const body = github.event.comment.body
const result = body.split[" "][1]
console.log(result)
- uses: actions/checkout@v3
- name: Install Packages
run: yarn --cwd ./scripts install --frozen-lockfile
- name: Submit Request to Discord
run: node --no-warnings ./scripts/verify/index.js
env:
DISCORD_VERIFY_WEBHOOK: ${{ secrets.DISCORD_VERIFY_WEBHOOK }}
EXTENSION_KEY: ${{ steps.process-comment.outputs.result }}
- uses: actions/github-script@v6
with:
script: |
Expand Down
15 changes: 15 additions & 0 deletions scripts/common/extensionDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,18 @@ export async function getExtensionDetails() {
return { id, data };
}
}

export async function getExtensionDetailsFromKey(key) {
const item = data[key];

console.log(data);

const result = await fetch(item);

if (result.ok) {
const markdown = await result.text();
const data = matter(markdown)["data"];

return { key, data };
}
}
8 changes: 4 additions & 4 deletions scripts/verify/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fetch from "node-fetch";
import { getExtensionDetails } from "../common/extensionDetails.js";
import { getExtensionDetailsFromKey } from "../common/extensionDetails.js";

function createDiscordVerificationPost(id, data) {
const text = `## Extension Verfication Request\n\n*${data.title}* would like to be verified.\nIt can be installed via this [store page](https://extensions.owlbear.rodeo/${id}).\n\nTo be verified the extension must meet these criteria:\n\n- Extension design uses accessible colors\n- Extension design uses accessible font sizes\n- Extension is legible with Owlbear Rodeo’s light and dark theme\n- Extension is fully functional on mobile devices (1)\n- Extension is fully functional across all major browsers (2)\n- Extension requires no other extensions to be installed\n- Extension functions in a private browsing window or with cookies disabled\n- Extension makes proper use of the Owlbear Rodeo APIs (3)\n- Extension functions in all configurations of an Owlbear Rodeo Room (4)\n- Extension provides user support for queries, issues and requests\n- Extension has no known bugs\n- Extension manifest is hosted on a custom domain controlled by the extension developer\n\nNotes:\n\n1) This includes iPhone’s, Android devices as well as tablets such as an iPad.\n\n2) Major browsers include Chrome, Firefox and Safari\n\n3) For example the Scene API is only used to store data that shares the Scene lifecycle\n\n4) Valid configurations include a Room with a Scene open and no Scene open\n\nAlso note that the term “fully functional” above means all extension functionally works correctly whereas the term “functional” means the extension still functions but some features may not be available.`;
Expand All @@ -11,8 +11,8 @@ function createDiscordVerificationPost(id, data) {
return post;
}

export async function sendDiscordWebhook() {
const { id, data } = await getExtensionDetails();
export async function sendDiscordWebhook(key) {
const { key: id, data } = await getExtensionDetailsFromKey(key);

const embed = createDiscordVerificationPost(id, data);

Expand All @@ -31,4 +31,4 @@ export async function sendDiscordWebhook() {
}
}

await sendDiscordWebhook();
await sendDiscordWebhook(process.env.EXTENSION_KEY);

0 comments on commit 482df2f

Please sign in to comment.