From 95d333b40fdac2f6a90a3d44d65b7c11ed918812 Mon Sep 17 00:00:00 2001 From: Hpsy <136253594+HauntPsy777@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:12:17 +0000 Subject: [PATCH 1/6] fix: support Emoji 15 ordering across all packs Signed-off-by: Hpsy <136253594+HauntPsy777@users.noreply.github.com> --- src/extractors/fluent-generic.ts | 53 +++++++++-- src/extractors/mutant.ts | 26 ++++-- src/extractors/noto.ts | 25 ++++-- src/extractors/twemoji.ts | 6 +- src/sorting.ts | 145 +++++++++++++++++++++++++++++++ 5 files changed, 239 insertions(+), 16 deletions(-) create mode 100644 src/sorting.ts diff --git a/src/extractors/fluent-generic.ts b/src/extractors/fluent-generic.ts index cf2a76d..9ead600 100644 --- a/src/extractors/fluent-generic.ts +++ b/src/extractors/fluent-generic.ts @@ -2,6 +2,7 @@ import { existsSync } from "fs" import { copyFile, mkdir, readdir, readFile, writeFile } from "fs/promises" import { join as joinPath } from "path" import { packsDir } from "../app.js" +import { sortEmojis } from "../sorting.js" import { FLUENT_TONE_DIRS, FLUENT_TONE_DIR_TO_CODEPOINT, @@ -96,10 +97,21 @@ const copySingle = async ( export const copyFluent = async (flavorName: string, toPath: string) => { const fluentEmojiDir = joinPath(packsDir, "fluent", "assets") - const emojis = await readdir(fluentEmojiDir) + let emojis = await readdir(fluentEmojiDir) if (!existsSync(toPath)) await mkdir(toPath) + // Process all emojis to get their filenames + const emojiFilenames: string[] = [] + const emojiMetadata: Map< + string, + { + emojiPath: string + codepoints: string[] + hasSkinTones: boolean + } + > = new Map() + for (let emoji of emojis) { const emojiPath = joinPath(fluentEmojiDir, emoji) const emojiDirContents = (await readdir(emojiPath)).filter( @@ -111,12 +123,43 @@ export const copyFluent = async (flavorName: string, toPath: string) => { ) const codepoints = metadataFile.unicode.split(" ") - const hasSkinTones = emojiDirContents.includes("Medium-Dark") // name unlikely to be reused + const hasSkinTones = emojiDirContents.includes("Medium-Dark") + + const filename = hasSkinTones + ? codepoints.join("-") + ".svg" + : codepoints + .filter((x) => x !== VARIANT_SELECTOR_EMOJI) + .join("-") + ".svg" + + emojiFilenames.push(filename) + emojiMetadata.set(filename, { + emojiPath, + codepoints, + hasSkinTones, + }) + } - if (hasSkinTones) { - copyWithSkinTones(toPath, flavorName, emojiPath, codepoints) + // Sort emojis according to Emoji 15 ordering + const sortedFilenames = await sortEmojis(emojiFilenames) + + // Copy emojis in sorted order + for (const filename of sortedFilenames) { + const metadata = emojiMetadata.get(filename)! + + if (metadata.hasSkinTones) { + await copyWithSkinTones( + toPath, + flavorName, + metadata.emojiPath, + metadata.codepoints + ) } else { - copySingle(toPath, flavorName, emojiPath, codepoints) + await copySingle( + toPath, + flavorName, + metadata.emojiPath, + metadata.codepoints + ) } } } diff --git a/src/extractors/mutant.ts b/src/extractors/mutant.ts index 33482e7..f2cde09 100644 --- a/src/extractors/mutant.ts +++ b/src/extractors/mutant.ts @@ -2,6 +2,7 @@ import { existsSync } from "fs" import { copyFile, mkdir, readdir } from "fs/promises" import { join as joinPath } from "path" import { packsDir } from "../app.js" +import { sortEmojis } from "../sorting.js" import { VARIANT_SELECTOR_EMOJI } from "../constants.js" export const copyMutantTo = async (outDir: string) => { @@ -9,11 +10,10 @@ export const copyMutantTo = async (outDir: string) => { if (!existsSync(outDir)) await mkdir(outDir) - const mutantSvgs = await readdir(mutantDir) - - for (const emoji of mutantSvgs) { - const inPath = joinPath(mutantDir, emoji) + let mutantSvgs = await readdir(mutantDir) + // Normalize filenames first + const normalizedSvgs = mutantSvgs.map((emoji) => { const codepoints = emoji.split("-") const normalizedFilename = codepoints.length === 2 @@ -21,7 +21,23 @@ export const copyMutantTo = async (outDir: string) => { .filter((x) => x !== VARIANT_SELECTOR_EMOJI) .join("-") : codepoints.join("-") - const outPath = joinPath(outDir, normalizedFilename) + return { original: emoji, normalized: normalizedFilename } + }) + + // Sort by normalized filename + const sortedNormalized = await sortEmojis( + normalizedSvgs.map((x) => x.normalized) + ) + + // Create reverse mapping + const normalizedToOriginal = new Map( + normalizedSvgs.map((x) => [x.normalized, x.original]) + ) + + for (const normalized of sortedNormalized) { + const original = normalizedToOriginal.get(normalized)! + const inPath = joinPath(mutantDir, original) + const outPath = joinPath(outDir, normalized) await copyFile(inPath, outPath) } diff --git a/src/extractors/noto.ts b/src/extractors/noto.ts index 5ab4987..3f40580 100644 --- a/src/extractors/noto.ts +++ b/src/extractors/noto.ts @@ -2,21 +2,36 @@ import { existsSync } from "fs" import { copyFile, mkdir, readdir } from "fs/promises" import { join as joinPath } from "path" import { packsDir } from "../app.js" +import { sortEmojis } from "../sorting.js" export const copyNotoTo = async (outDir: string) => { const notoDir = joinPath(packsDir, "noto", "svg") if (!existsSync(outDir)) await mkdir(outDir) - const notoSvgs = await readdir(notoDir) - - for (const emoji of notoSvgs) { - const inPath = joinPath(notoDir, emoji) + let notoSvgs = await readdir(notoDir) + // Sort emojis according to Emoji 15 ordering + const normalizedSvgs = notoSvgs.map((emoji) => { const normalizedFilename = emoji .replace("emoji_u", "") .replaceAll("_", "-") - const outPath = joinPath(outDir, normalizedFilename) + return { original: emoji, normalized: normalizedFilename } + }) + + const sortedNormalized = await sortEmojis( + normalizedSvgs.map((x) => x.normalized) + ) + + // Create reverse mapping + const normalizedToOriginal = new Map( + normalizedSvgs.map((x) => [x.normalized, x.original]) + ) + + for (const normalized of sortedNormalized) { + const original = normalizedToOriginal.get(normalized)! + const inPath = joinPath(notoDir, original) + const outPath = joinPath(outDir, normalized) await copyFile(inPath, outPath) } diff --git a/src/extractors/twemoji.ts b/src/extractors/twemoji.ts index 2638f3d..4f0c66b 100644 --- a/src/extractors/twemoji.ts +++ b/src/extractors/twemoji.ts @@ -2,6 +2,7 @@ import { copyFile, mkdir, readdir } from "fs/promises" import { existsSync } from "fs" import { join as joinPath } from "path" import { packsDir } from "../app.js" +import { sortEmojis } from "../sorting.js" export const getAllExistingTwemoji = async () => { let out: string[] = [] @@ -22,7 +23,10 @@ export const copyTwemojiTo = async (outDir: string) => { if (!existsSync(outDir)) await mkdir(outDir) - const twemojiSvgs = await readdir(twemojiDir) + let twemojiSvgs = await readdir(twemojiDir) + + // Sort emojis according to Emoji 15 ordering + twemojiSvgs = await sortEmojis(twemojiSvgs) for (const emoji of twemojiSvgs) { const inPath = joinPath(twemojiDir, emoji) diff --git a/src/sorting.ts b/src/sorting.ts new file mode 100644 index 0000000..ad3abb4 --- /dev/null +++ b/src/sorting.ts @@ -0,0 +1,145 @@ +import https from "https" +import { existsSync } from "fs" +import { readFile } from "fs/promises" +import { join as joinPath } from "path" +import { cwd } from "./app.js" + +export type Emoji15Ordering = { + [key: string]: number +} + +let cachedOrdering: Emoji15Ordering | null = null + +/** + * Download and cache the Emoji 15 ordering from Google Fonts + */ +const downloadEmoji15Ordering = async (): Promise => { + return new Promise((resolve, reject) => { + const url = + "https://raw.githubusercontent.com/googlefonts/noto-emoji/main/ordering/emoji_15_0_ordering.json" + + https + .get(url, (response) => { + let data = "" + + response.on("data", (chunk) => { + data += chunk + }) + + response.on("end", () => { + try { + const ordering = JSON.parse(data) + resolve(ordering) + } catch (error) { + reject(error) + } + }) + }) + .on("error", (error) => { + reject(error) + }) + }) +} + +/** + * Get the Emoji 15 ordering, either from cache, local file, or remote + */ +export const getEmoji15Ordering = async (): Promise => { + if (cachedOrdering) { + return cachedOrdering + } + + const orderingFilePath = joinPath(cwd, ".emoji15-ordering.json") + + // Try to load from local cache first + if (existsSync(orderingFilePath)) { + try { + const fileContent = await readFile(orderingFilePath, "utf-8") + cachedOrdering = JSON.parse(fileContent) + return cachedOrdering + } catch (error) { + console.warn( + "Warning: Failed to load cached Emoji 15 ordering, fetching from remote..." + ) + } + } + + // Download from remote + try { + console.log("Fetching Emoji 15 ordering from Google Fonts...") + const ordering = await downloadEmoji15Ordering() + cachedOrdering = ordering + + // Cache locally for future runs + try { + const fs = await import("fs/promises") + await fs.writeFile( + orderingFilePath, + JSON.stringify(ordering, null, 2) + ) + } catch (error) { + console.warn("Warning: Failed to cache Emoji 15 ordering locally") + } + + return ordering + } catch (error) { + console.error( + "Error fetching Emoji 15 ordering:", + error instanceof Error ? error.message : error + ) + throw error + } +} + +/** + * Convert emoji codepoints to a format that can be looked up in the ordering + */ +export const codepointsToOrderingKey = (codepoints: string[]): string => { + // Convert codepoint array like ["1f600"] to format used in ordering + // Filter out variant selectors (fe0f) + const filtered = codepoints + .filter((cp) => cp !== "fe0f") + .map((cp) => `U+${cp.toUpperCase()}`) + + return filtered.join(" ") +} + +/** + * Get the sort order value for a given emoji codepoint + */ +export const getEmojiSortOrder = async ( + codepoints: string[] +): Promise => { + const ordering = await getEmoji15Ordering() + const key = codepointsToOrderingKey(codepoints) + + // Return the order from the Emoji 15 ordering, or a high number if not found + return ordering[key] ?? Infinity +} + +/** + * Sort emoji filenames according to Emoji 15 ordering + * Filenames are expected to be in format: "xxxx-yyyy-zzzz.svg" + */ +export const sortEmojis = async (filenames: string[]): Promise => { + const ordering = await getEmoji15Ordering() + + // Create a map of filename to sort order + const filenameToOrder: Map = new Map() + + for (const filename of filenames) { + // Extract codepoints from filename (remove .svg extension) + const codepoints = filename.replace(/\.svg$/, "").split("-") + const key = codepointsToOrderingKey(codepoints) + const order = ordering[key] ?? Infinity + + filenameToOrder.set(filename, order) + } + + // Sort filenames by their order value, maintaining original order for ties + return [...filenames].sort((a, b) => { + const orderA = filenameToOrder.get(a) ?? Infinity + const orderB = filenameToOrder.get(b) ?? Infinity + return orderA - orderB + }) +} From c1a431d1f732ce9b3d772e53c44fd6062dc3dd9d Mon Sep 17 00:00:00 2001 From: Hpsy <136253594+HauntPsy777@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:31:37 +0000 Subject: [PATCH 2/6] fix(ci): use GITHUB_TOKEN for GitHub CLI in workflow Signed-off-by: Hpsy <136253594+HauntPsy777@users.noreply.github.com> --- .github/workflows/triage_issue.yml | 4 ++-- .github/workflows/triage_pr.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/triage_issue.yml b/.github/workflows/triage_issue.yml index ecc69f5..76afb4d 100644 --- a/.github/workflows/triage_issue.yml +++ b/.github/workflows/triage_issue.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Get project data env: - GITHUB_TOKEN: ${{ secrets.PAT }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh api graphql -f query=' query { @@ -39,7 +39,7 @@ jobs: - name: Add issue to project env: - GITHUB_TOKEN: ${{ secrets.PAT }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} ISSUE_ID: ${{ github.event.issue.node_id }} run: | item_id="$( gh api graphql -f query=' diff --git a/.github/workflows/triage_pr.yml b/.github/workflows/triage_pr.yml index 3010d2e..466849d 100644 --- a/.github/workflows/triage_pr.yml +++ b/.github/workflows/triage_pr.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Get project data env: - GITHUB_TOKEN: ${{ secrets.PAT }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh api graphql -f query=' query { @@ -39,7 +39,7 @@ jobs: - name: Add PR to project env: - GITHUB_TOKEN: ${{ secrets.PAT }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_ID: ${{ github.event.pull_request.node_id }} run: | item_id="$( gh api graphql -f query=' @@ -55,7 +55,7 @@ jobs: - name: Set fields env: - GITHUB_TOKEN: ${{ secrets.PAT }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh api graphql -f query=' mutation ( From 06da30f90e4e70e5e7a3f3e7671eca8b8ff9ee84 Mon Sep 17 00:00:00 2001 From: Hpsy <136253594+HauntPsy777@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:39:17 +0000 Subject: [PATCH 3/6] fix(ci): use GITHUB_TOKEN for GitHub CLI in workflow Signed-off-by: Hpsy <136253594+HauntPsy777@users.noreply.github.com> --- .github/workflows/triage_issue.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/triage_issue.yml b/.github/workflows/triage_issue.yml index 76afb4d..e513cd8 100644 --- a/.github/workflows/triage_issue.yml +++ b/.github/workflows/triage_issue.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Get project data env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} run: | gh api graphql -f query=' query { @@ -39,7 +39,7 @@ jobs: - name: Add issue to project env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} ISSUE_ID: ${{ github.event.issue.node_id }} run: | item_id="$( gh api graphql -f query=' From 6f5370bdd623a0dc18695df3dff2f55791b833d3 Mon Sep 17 00:00:00 2001 From: Hpsy <136253594+HauntPsy777@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:48:54 +0000 Subject: [PATCH 4/6] fix(ci): use GITHUB_TOKEN for GitHub CLI in workflow Signed-off-by: Hpsy <136253594+HauntPsy777@users.noreply.github.com> --- .github/workflows/triage_issue.yml | 18 ++++++++++++------ .github/workflows/triage_pr.yml | 22 ++++++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/triage_issue.yml b/.github/workflows/triage_issue.yml index e513cd8..b5a3bed 100644 --- a/.github/workflows/triage_issue.yml +++ b/.github/workflows/triage_issue.yml @@ -4,14 +4,20 @@ on: issues: types: [opened] +permissions: + contents: read + issues: write + projects: write + jobs: track_issue: runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Get project data - env: - GH_TOKEN: ${{ github.token }} run: | + set -eo pipefail gh api graphql -f query=' query { organization(login: "revoltchat"){ @@ -33,15 +39,15 @@ jobs: } }' > project_data.json - echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV - echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV + echo 'PROJECT_ID='$(jq -r '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV + echo 'STATUS_FIELD_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV + echo 'TODO_OPTION_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV - name: Add issue to project env: - GH_TOKEN: ${{ github.token }} ISSUE_ID: ${{ github.event.issue.node_id }} run: | + set -eo pipefail item_id="$( gh api graphql -f query=' mutation($project:ID!, $issue:ID!) { addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) { diff --git a/.github/workflows/triage_pr.yml b/.github/workflows/triage_pr.yml index 466849d..ac18d18 100644 --- a/.github/workflows/triage_pr.yml +++ b/.github/workflows/triage_pr.yml @@ -4,14 +4,21 @@ on: pull_request_target: types: [opened, synchronize, ready_for_review, review_requested] +permissions: + contents: read + pull-requests: write + issues: write + projects: write + jobs: track_pr: runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Get project data - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + set -eo pipefail gh api graphql -f query=' query { organization(login: "revoltchat"){ @@ -33,15 +40,15 @@ jobs: } }' > project_data.json - echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV - echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'INCOMING_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🆕 Untriaged") |.id' project_data.json) >> $GITHUB_ENV + echo 'PROJECT_ID='$(jq -r '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV + echo 'STATUS_FIELD_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV + echo 'INCOMING_OPTION_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🆕 Untriaged") |.id' project_data.json) >> $GITHUB_ENV - name: Add PR to project env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_ID: ${{ github.event.pull_request.node_id }} run: | + set -eo pipefail item_id="$( gh api graphql -f query=' mutation($project:ID!, $pr:ID!) { addProjectV2ItemById(input: {projectId: $project, contentId: $pr}) { @@ -54,9 +61,8 @@ jobs: echo 'ITEM_ID='$item_id >> $GITHUB_ENV - name: Set fields - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + set -eo pipefail gh api graphql -f query=' mutation ( $project: ID! From 141a42cdce7f06af9052bbf0e645c679844617e2 Mon Sep 17 00:00:00 2001 From: Hpsy <136253594+HauntPsy777@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:52:30 +0000 Subject: [PATCH 5/6] fix(ci): use GITHUB_TOKEN for GitHub CLI in workflow Signed-off-by: Hpsy <136253594+HauntPsy777@users.noreply.github.com> --- .github/workflows/triage_issue.yml | 6 +++++- .github/workflows/triage_pr.yml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/triage_issue.yml b/.github/workflows/triage_issue.yml index b5a3bed..a3a1f43 100644 --- a/.github/workflows/triage_issue.yml +++ b/.github/workflows/triage_issue.yml @@ -15,6 +15,10 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + - name: Get project data run: | set -eo pipefail @@ -41,7 +45,7 @@ jobs: echo 'PROJECT_ID='$(jq -r '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV echo 'STATUS_FIELD_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'TODO_OPTION_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV + echo 'TODO_OPTION_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") | .id' project_data.json) >> $GITHUB_ENV - name: Add issue to project env: diff --git a/.github/workflows/triage_pr.yml b/.github/workflows/triage_pr.yml index ac18d18..6607ccf 100644 --- a/.github/workflows/triage_pr.yml +++ b/.github/workflows/triage_pr.yml @@ -16,6 +16,10 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + - name: Get project data run: | set -eo pipefail @@ -42,7 +46,7 @@ jobs: echo 'PROJECT_ID='$(jq -r '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV echo 'STATUS_FIELD_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'INCOMING_OPTION_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🆕 Untriaged") |.id' project_data.json) >> $GITHUB_ENV + echo 'INCOMING_OPTION_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🆕 Untriaged") | .id' project_data.json) >> $GITHUB_ENV - name: Add PR to project env: From adb5fd2116546c01ba4deb5cf8854f9de36eb772 Mon Sep 17 00:00:00 2001 From: Hpsy <136253594+HauntPsy777@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:09:10 +0000 Subject: [PATCH 6/6] fix(ci): authenticate gh CLI with runtime token and safer env writes Signed-off-by: Hpsy <136253594+HauntPsy777@users.noreply.github.com> --- .github/workflows/triage_issue.yml | 10 +++++----- .github/workflows/triage_pr.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/triage_issue.yml b/.github/workflows/triage_issue.yml index a3a1f43..a3535ed 100644 --- a/.github/workflows/triage_issue.yml +++ b/.github/workflows/triage_issue.yml @@ -13,11 +13,11 @@ jobs: track_issue: runs-on: ubuntu-latest env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} steps: - name: Authenticate GitHub CLI run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + echo "${{ github.token }}" | gh auth login --with-token - name: Get project data run: | @@ -43,9 +43,9 @@ jobs: } }' > project_data.json - echo 'PROJECT_ID='$(jq -r '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV - echo 'STATUS_FIELD_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'TODO_OPTION_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") | .id' project_data.json) >> $GITHUB_ENV + echo "PROJECT_ID=$(jq -r '.data.organization.projectV2.id' project_data.json)" >> $GITHUB_ENV + echo "STATUS_FIELD_ID=$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== \"Status\") | .id' project_data.json)" >> $GITHUB_ENV + echo "TODO_OPTION_ID=$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== \"Status\") | .options[] | select(.name==\"Todo\") | .id' project_data.json)" >> $GITHUB_ENV - name: Add issue to project env: diff --git a/.github/workflows/triage_pr.yml b/.github/workflows/triage_pr.yml index 6607ccf..f1cb836 100644 --- a/.github/workflows/triage_pr.yml +++ b/.github/workflows/triage_pr.yml @@ -14,11 +14,11 @@ jobs: track_pr: runs-on: ubuntu-latest env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ github.token }} steps: - name: Authenticate GitHub CLI run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token + echo "${{ github.token }}" | gh auth login --with-token - name: Get project data run: | @@ -44,9 +44,9 @@ jobs: } }' > project_data.json - echo 'PROJECT_ID='$(jq -r '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV - echo 'STATUS_FIELD_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'INCOMING_OPTION_ID='$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🆕 Untriaged") | .id' project_data.json) >> $GITHUB_ENV + echo "PROJECT_ID=$(jq -r '.data.organization.projectV2.id' project_data.json)" >> $GITHUB_ENV + echo "STATUS_FIELD_ID=$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== \"Status\") | .id' project_data.json)" >> $GITHUB_ENV + echo "INCOMING_OPTION_ID=$(jq -r '.data.organization.projectV2.fields.nodes[] | select(.name== \"Status\") | .options[] | select(.name==\"🆕 Untriaged\") | .id' project_data.json)" >> $GITHUB_ENV - name: Add PR to project env: