Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/actions/multi-approvers/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@ inputs:
token:
description: 'GitHub token with at least members:read, pull_requests:read, and actions:write permissions.'
required: true
type: 'string'
team:
description: "Team slug. The team's organization must be in the repository's organization. Example: feature-team"
required: true
type: 'string'
user-id-allowlist:
description: 'A comma-seperated list of GitHub User IDs to be allowlisted. PRs from these User IDs will not be subject to multi-approvers requirements. This should be used exclusively for bots that cannot be included in the GitHub team.'
required: false
type: 'string'

runs:
using: 'node20'
main: 'dist/index.js'
main: 'dist/index.mjs'
19 changes: 19 additions & 0 deletions .github/actions/multi-approvers/bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail

echo ">>> Building multi-approvers bundle via ncc..."
npx ncc build -m src/main.ts -o dist

echo ">>> Renaming bundle to dist/index.mjs..."
mv dist/index.js dist/index.mjs

echo ">>> Upgrading legacy CommonJS scope variables inside bundle..."
perl -pi -e 's/\b__dirname\b/import.meta.dirname/g' dist/index.mjs

echo ">>> Normalizing corporate registry links to public npmjs in lockfile..."
perl -pi -e 's|https://us-npm\.pkg\.dev/[^/]+/[^/]+/|https://registry.npmjs.org/|g' package-lock.json

echo ">>> Purging unwanted dist/package.json artifact..."
rm -f dist/package.json

echo ">>> Build and normalization complete!"
4 changes: 1 addition & 3 deletions .github/actions/multi-approvers/bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ files_input="$(find ./* -type f -not -path './node_modules/*' -name '*.test.ts'
readarray -t files <<<"${files_input}"

set -x
exec node \
--require ts-node/register \
--test-reporter spec \
exec npx tsx \
--test "${files[@]}"
3 changes: 0 additions & 3 deletions .github/actions/multi-approvers/dist/index.js

This file was deleted.

13 changes: 13 additions & 0 deletions .github/actions/multi-approvers/dist/index.mjs

Large diffs are not rendered by default.

Loading
Loading