Skip to content

Commit

Permalink
fix: misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Feb 14, 2023
1 parent 7e1b67b commit 0f5c6af
Show file tree
Hide file tree
Showing 16 changed files with 111 additions and 120 deletions.
5 changes: 4 additions & 1 deletion .github/actions/audit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ inputs:
runs:
using: composite
steps:
- name: Run Audit
- name: Run Production Audit
shell: ${{ inputs.shell }}
run: |
npm audit --omit=dev
- name: Run Full Audit
shell: ${{ inputs.shell }}
run: |
npm audit --audit-level=none
2 changes: 1 addition & 1 deletion .github/actions/changed-files/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
required: true

outputs:
files:
names:
value: ${{ steps.files.outputs.result }}

runs:
Expand Down
15 changes: 4 additions & 11 deletions .github/actions/changed-workspaces/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@ 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
description: json stringified array of file names or --all

outputs:
flags:
Expand All @@ -24,14 +17,14 @@ runs:
steps:
- name: Get Changed Files
uses: ./.github/actions/changed-files
if: ${{ !inputs.all && !inputs.files }}
if: ${{ !inputs.files }}
id: files
with:
token: ${{ inputs.token }}

- name: Get Workspaces
shell: ${{ inputs.shell }}
shell: bash
id: workspaces
run: |
flags=$(npm exec --offline -- template-oss-changed-workspaces '${{ (inputs.all && '--all') || (inputs.files || steps.files.outputs.result) }}')
flags=$(npm exec --offline -- template-oss-changed-workspaces '${{ inputs.files || steps.files.outputs.names }}')
echo "flags=${flags}" >> $GITHUB_OUTPUT
3 changes: 3 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ runs:
shell: ${{ inputs.shell }}
run: |
npm run lint --ignore-scripts ${{ inputs.flags }}
- name: Post Lint
shell: ${{ inputs.shell }}
run: |
npm run postlint --ignore-scripts ${{ inputs.flags }}
12 changes: 5 additions & 7 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ inputs:
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
default: 'true'
deps-command:
description: command to run for the dependencies step
default: install --ignore-scripts --no-audit --no-fund
Expand All @@ -40,12 +38,12 @@ runs:
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: ${{ (inputs.cache && 'npm') || null }}
cache: ${{ (inputs.cache == 'true' && 'npm') || '' }}

- name: Check Node Version
if: inputs.npm-version
id: node-version
shell: ${{ inputs.shell }}
shell: bash
run: |
NODE_VERSION=$(node --version)
echo $NODE_VERSION
Expand Down Expand Up @@ -83,13 +81,13 @@ runs:
run: npm -v

- name: Setup Dependencies
if: inputs.deps
if: inputs.deps == 'true'
uses: ./.github/actions/deps
with:
command: ${{ inputs.deps-command }}
flags: ${{ inputs.deps-flags }}

- name: Add Problem Matcher
shell: ${{ inputs.shell }}
shell: bash
run: |
[[ -f ./.github/matchers/tap.json ]] && echo "::add-matcher::.github/matchers/tap.json"
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
uses: ./.github/actions/changed-workspaces
with:
token: ${{ secrets.GITHUB_TOKEN }}
all: ${{ inputs.all }}
files: ${{ (inputs.all && '--all') || '' }}

- name: Lint
uses: ./.github/actions/lint
Expand Down Expand Up @@ -113,6 +113,7 @@ jobs:
steps:
- name: Continue Matrix Run
id: continue-matrix
shell: bash
run: |
if [[ "${{ matrix.node-version }}" == "14.17.0" || "${{ inputs.all }}" == "true" ]]; then
echo "result=true" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -148,9 +149,8 @@ jobs:
continue-on-error: ${{ !!steps.check.outputs.check-id }}
uses: ./.github/actions/changed-workspaces
with:
shell: ${{ matrix.platform.shell }}
token: ${{ secrets.GITHUB_TOKEN }}
all: ${{ inputs.all }}
files: ${{ (inputs.all && '--all') || '' }}

- name: Test
if: steps.continue-matrix.outputs.result
Expand Down
2 changes: 1 addition & 1 deletion bin/changed-workspaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const main = async ({ cwd, files, all }) => {

const arg = process.argv[2]
const all = arg === '--all'
const files = all ? [] : JSON.parse(arg ?? '[]')
const files = all ? [] : JSON.parse(arg || '[]')

module.exports = main({
cwd: process.cwd(),
Expand Down

0 comments on commit 0f5c6af

Please sign in to comment.