-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
241dbf2
commit 3912b10
Showing
86 changed files
with
4,566 additions
and
3,535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file is automatically added by @npmcli/template-oss. Do not edit. | ||
|
||
name: Audit | ||
|
||
inputs: | ||
shell: | ||
description: shell to run on | ||
default: bash | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Run Audit | ||
shell: ${{ inputs.shell }} | ||
run: | | ||
npm audit --omit=dev | ||
npm audit --audit-level=none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This file is automatically added by @npmcli/template-oss. Do not edit. | ||
|
||
name: Get Changed Files | ||
|
||
inputs: | ||
token: | ||
description: GitHub token to use | ||
required: true | ||
|
||
outputs: | ||
files: | ||
value: ${{ steps.files.outputs.result }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get Changed Files | ||
uses: actions/github-script@v6 | ||
id: files | ||
with: | ||
github-token: ${{ inputs.token }} | ||
script: | | ||
const { repo: { owner, repo }, eventName, payload, sha } = context | ||
let files | ||
if (eventName === 'pull_request' || eventName === 'pull_request_target') { | ||
files = await github.paginate(github.rest.pulls.listFiles, { | ||
owner, | ||
repo, | ||
pull_number: payload.pull_request.number, | ||
}) | ||
} else { | ||
const { data: commit } = await github.rest.repos.getCommit({ | ||
owner, | ||
repo, | ||
ref: sha, | ||
}) | ||
files = commit.files | ||
} | ||
return files.map(f => f.filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This file is automatically added by @npmcli/template-oss. Do not edit. | ||
|
||
name: Get Changed Workspaces | ||
|
||
inputs: | ||
token: | ||
description: GitHub token to use | ||
shell: | ||
description: shell to run on | ||
default: bash | ||
all: | ||
default: false | ||
type: boolean | ||
files: | ||
description: json stringified array of file names | ||
type: string | ||
|
||
outputs: | ||
flags: | ||
value: ${{ steps.workspaces.outputs.flags }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get Changed Files | ||
uses: ./.github/actions/changed-files | ||
if: ${{ !inputs.all && !inputs.files }} | ||
id: files | ||
with: | ||
token: ${{ inputs.token }} | ||
|
||
- name: Get Workspaces | ||
shell: ${{ inputs.shell }} | ||
id: workspaces | ||
run: | | ||
flags=$(npm exec --offline -- template-oss-changed-workspaces '${{ (inputs.all && '--all') || (inputs.files || steps.files.outputs.result) }}') | ||
echo "flags=${flags}" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# This file is automatically added by @npmcli/template-oss. Do not edit. | ||
|
||
name: Conclude Check | ||
description: Conclude a check | ||
|
||
inputs: | ||
token: | ||
description: GitHub token to use | ||
required: true | ||
conclusion: | ||
description: conclusion of check | ||
require: true | ||
check-id: | ||
description: id of check to conclude | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Conclude Check | ||
uses: LouisBrunner/[email protected] | ||
with: | ||
token: ${{ inputs.token }} | ||
conclusion: ${{ inputs.conclusion }} | ||
check_id: ${{ inputs.check-id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# This file is automatically added by @npmcli/template-oss. Do not edit. | ||
|
||
name: Create Check | ||
description: Create a check and associate it with a sha | ||
|
||
inputs: | ||
token: | ||
description: GitHub token to use | ||
required: true | ||
sha: | ||
description: sha to attach the check to | ||
required: true | ||
job-name: | ||
description: Name of the job to find | ||
required: true | ||
job-status: | ||
description: Status of the check being created | ||
default: in_progress | ||
|
||
outputs: | ||
check-id: | ||
description: The ID of the check that was created | ||
value: ${{ steps.check.outputs.check_id }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get Workflow Job | ||
uses: actions/github-script@v6 | ||
id: workflow-job | ||
env: | ||
JOB_NAME: ${{ inputs.job-name }} | ||
with: | ||
github-token: ${{ inputs.token }} | ||
script: | | ||
const { JOB_NAME } = process.env | ||
const { repo: { owner, repo }, runId, serverUrl } = context | ||
const jobs = await github.paginate(github.rest.actions.listJobsForWorkflowRun, { | ||
owner, | ||
repo, | ||
run_id: runId, | ||
}) | ||
const job = jobs.find(j => j.name.endsWith(JOB_NAME)) | ||
const shaUrl = `${serverUrl}/${owner}/${repo}/commit/${{ inputs.sha }}` | ||
const summary = `This check is assosciated with ${shaUrl}\n\n` | ||
const message = job?.html_url | ||
? `For run logs, click here: ${job.html_url}` | ||
: `Run logs could not be found for a job with name: "${JOB_NAME}"` | ||
// Return a json object with properties that LouisBrunner/checks-actions | ||
// expects as the output of the check | ||
return { summary: summary + message } | ||
- name: Create Check | ||
uses: LouisBrunner/[email protected] | ||
id: check | ||
with: | ||
token: ${{ inputs.token }} | ||
status: ${{ inputs.job-status }} | ||
name: ${{ inputs.job-name }} | ||
sha: ${{ inputs.sha }} | ||
output: ${{ steps.workflow-job.outputs.result }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file is automatically added by @npmcli/template-oss. Do not edit. | ||
|
||
name: Dependencies | ||
|
||
inputs: | ||
command: | ||
description: command to run for the dependencies step | ||
default: install --ignore-scripts --no-audit --no-fund | ||
flags: | ||
description: extra flags to pass to the dependencies step | ||
shell: | ||
description: shell to run on | ||
default: bash | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Dependencies | ||
shell: ${{ inputs.shell }} | ||
run: npm ${{ inputs.command }} ${{ inputs.flags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This file is automatically added by @npmcli/template-oss. Do not edit. | ||
|
||
name: Lint | ||
|
||
inputs: | ||
flags: | ||
description: flags to pass to the commands | ||
shell: | ||
description: shell to run on | ||
default: bash | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Lint | ||
shell: ${{ inputs.shell }} | ||
run: | | ||
npm run lint --ignore-scripts ${{ inputs.flags }} | ||
npm run postlint --ignore-scripts ${{ inputs.flags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# This file is automatically added by @npmcli/template-oss. Do not edit. | ||
|
||
name: Setup Repo | ||
description: Setup a repo with standard tools | ||
|
||
inputs: | ||
node-version: | ||
description: node version to use | ||
default: 18.x | ||
npm-version: | ||
description: npm version to use | ||
default: latest | ||
cache: | ||
description: whether to cache npm install or not | ||
type: boolean | ||
default: false | ||
shell: | ||
description: shell to run on | ||
default: bash | ||
deps: | ||
description: whether to run the deps step | ||
type: boolean | ||
default: true | ||
deps-command: | ||
description: command to run for the dependencies step | ||
default: install --ignore-scripts --no-audit --no-fund | ||
deps-flags: | ||
description: extra flags to pass to the dependencies step | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Git User | ||
shell: ${{ inputs.shell }} | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "npm CLI robot" | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: ${{ (inputs.cache && 'npm') || null }} | ||
|
||
- name: Check Node Version | ||
if: inputs.npm-version | ||
id: node-version | ||
shell: ${{ inputs.shell }} | ||
run: | | ||
NODE_VERSION=$(node --version) | ||
echo $NODE_VERSION | ||
if npx semver@7 -r "<=10" "$NODE_VERSION" --yes; then | ||
echo "ten-or-lower=true" >> $GITHUB_OUTPUT | ||
fi | ||
if npx semver@7 -r "<=14" "$NODE_VERSION" --yes; then | ||
echo "fourteen-or-lower=true" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Update Windows npm | ||
# node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows | ||
if: inputs.npm-version && runner.os == 'Windows' && steps.node-version.outputs.fourteen-or-lower | ||
shell: ${{ inputs.shell }} | ||
run: | | ||
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz | ||
tar xf npm-7.5.4.tgz | ||
cd package | ||
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz | ||
cd .. | ||
rmdir /s /q package | ||
- name: Install npm@7 | ||
if: inputs.npm-version && steps.node-version.outputs.ten-or-lower | ||
shell: ${{ inputs.shell }} | ||
run: npm i --prefer-online --no-fund --no-audit -g npm@7 | ||
|
||
- name: Install npm@${{ inputs.npm-version }} | ||
if: inputs.npm-version && !steps.node-version.outputs.ten-or-lower | ||
shell: ${{ inputs.shell }} | ||
run: npm i --prefer-online --no-fund --no-audit -g npm@${{ inputs.npm-version }} | ||
|
||
- name: npm Version | ||
shell: ${{ inputs.shell }} | ||
run: npm -v | ||
|
||
- name: Setup Dependencies | ||
if: inputs.deps | ||
uses: ./.github/actions/deps | ||
with: | ||
command: ${{ inputs.deps-command }} | ||
flags: ${{ inputs.deps-flags }} | ||
|
||
- name: Add Problem Matcher | ||
shell: ${{ inputs.shell }} | ||
run: | | ||
[[ -f ./.github/matchers/tap.json ]] && echo "::add-matcher::.github/matchers/tap.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This file is automatically added by @npmcli/template-oss. Do not edit. | ||
|
||
name: Test | ||
|
||
inputs: | ||
flags: | ||
description: flags to pass to the commands | ||
shell: | ||
description: shell to run on | ||
default: bash | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Test | ||
shell: ${{ inputs.shell }} | ||
run: npm test --ignore-scripts ${{ inputs.flags }} |
Oops, something went wrong.