Skip to content
Merged
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
22 changes: 16 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"name": "Alpine",
"image": "mcr.microsoft.com/devcontainers/base:alpine-3.21",
"name": "ci-github-nodejs",
"image": "mcr.microsoft.com/devcontainers/base:debian",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-extra/features/act:1": {}
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": false
},
"ghcr.io/devcontainers/features/github-cli:1": {
"extensions": "nektos/gh-act"
}
},
"remoteEnv": {
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
},
"customizations": {
"vscode": {
Expand All @@ -15,7 +22,10 @@
"github.copilot-chat",
"ms-vscode.makefile-tools",
"esbenp.prettier-vscode"
]
],
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh"
}
}
}
}
2 changes: 1 addition & 1 deletion .github/workflows/__greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: {}

jobs:
greetings:
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
permissions:
contents: read
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/__main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
release:
needs: ci
if: github.event_name != 'schedule'
uses: hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml@5ff7d4c3910971ed53834becd5967271b4e228cf # 0.21.1
uses: hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml@b56be562f38e0e3e712f09691a8fe930aae9db1b # 0.22.0
permissions:
contents: read
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/__need-fix-to-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions: {}

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
permissions:
contents: read
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/__semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions: {}

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
permissions:
contents: write
pull-requests: write
2 changes: 1 addition & 1 deletion .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions: {}

jobs:
linter:
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
permissions:
contents: read
statuses: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/__stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions: {}

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
permissions:
issues: write
pull-requests: write
2 changes: 1 addition & 1 deletion .github/workflows/__test-action-dependencies-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
unknown

- name: Assert - Check "dependencies-cache" configured cache
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const assert = require("assert");
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
unknown

- name: Assert - Check "has-installed-dependencies" outputs
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
INSTALLED_DEPENDENCIES: ${{ steps.act-has-installed-dependencies.outputs.installed-dependencies }}
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/__test-action-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,10 @@ jobs:
exit 1
fi

# Disable strict dep builds check for pnpm v11+ (strictDepBuilds defaults to true)
if [[ "$INSTALL_COMMAND" == pnpm* ]]; then
echo 'strictDepBuilds: false' > pnpm-workspace.yaml
fi

# Install the tarball to verify it's a valid npm package
$INSTALL_COMMAND "./$tarball_name"
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
packages: write
issues: read
pull-requests: read
uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@df8b445f6cc9661dcb282d897d7146a82e5f2960 # 0.31.0
uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@e4bf7a12228a2a4b5993d2d36b99b4dd0ec80bf5 # 0.32.1
with:
sign: false
images: |
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
path-mapping: ${{ steps.parse.outputs.path-mapping }}
steps:
- id: parse
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
CONTAINER_INPUT: ${{ inputs.container }}
CONTAINER_PASSWORD: ${{ secrets.container-password }}
Expand Down Expand Up @@ -293,7 +293,7 @@ jobs:
security-events: write
runs-on: *ci-runner
steps:
- uses: hoverkraft-tech/ci-github-common/actions/checkout@4b53189212d5810f710bed89711002626977215b # 0.33.0
- uses: hoverkraft-tech/ci-github-common/actions/checkout@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
- uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
with:
languages: ${{ inputs.code-ql }}
Expand All @@ -306,7 +306,7 @@ jobs:
contents: read
runs-on: *ci-runner
steps:
- uses: hoverkraft-tech/ci-github-common/actions/checkout@4b53189212d5810f710bed89711002626977215b # 0.33.0
- uses: hoverkraft-tech/ci-github-common/actions/checkout@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
- uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0

setup:
Expand Down Expand Up @@ -334,17 +334,17 @@ jobs:
steps:
- name: Checkout repository
if: inputs.container == ''
uses: hoverkraft-tech/ci-github-common/actions/checkout@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/actions/checkout@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2

- id: working-directory
uses: hoverkraft-tech/ci-github-common/actions/working-directory@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/actions/working-directory@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
with:
working-directory: ${{ inputs.working-directory }}
enforce-path-in-workspace: ${{ inputs.container && 'false' || 'true' }}

- id: build-variables
if: inputs.build != ''
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
WORKING_DIRECTORY: ${{ steps.working-directory.outputs.absolute-path }}
BUILD_INPUT: ${{ inputs.build }}
Expand Down Expand Up @@ -444,16 +444,16 @@ jobs:
packages: read
id-token: write # Needed for getting local workflow actions
steps:
- uses: hoverkraft-tech/ci-github-common/actions/checkout@4b53189212d5810f710bed89711002626977215b # 0.33.0
- uses: hoverkraft-tech/ci-github-common/actions/checkout@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
if: inputs.container == ''

- id: local-workflow-actions
uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
with:
actions-path: actions

- id: preparel-lint-options
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
LINT_INPUT: ${{ inputs.lint }}
with:
Expand Down Expand Up @@ -484,7 +484,7 @@ jobs:
path-mapping: ${{ needs.prepare.outputs.path-mapping || '' }}

# jscpd:ignore-start
- uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4b53189212d5810f710bed89711002626977215b # 0.33.0
- uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
if: always() && steps.local-workflow-actions.outputs.repository
with:
actions-path: actions
Expand All @@ -507,11 +507,11 @@ jobs:
outputs:
artifact-id: ${{ steps.build.outputs.artifact-id }}
steps:
- uses: hoverkraft-tech/ci-github-common/actions/checkout@4b53189212d5810f710bed89711002626977215b # 0.33.0
- uses: hoverkraft-tech/ci-github-common/actions/checkout@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
if: needs.setup.outputs.build-commands && inputs.container == ''

- id: local-workflow-actions
uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
with:
actions-path: actions

Expand All @@ -527,7 +527,7 @@ jobs:
build-artifact: ${{ needs.setup.outputs.build-artifact }}

# jscpd:ignore-start
- uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4b53189212d5810f710bed89711002626977215b # 0.33.0
- uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
if: always() && steps.local-workflow-actions.outputs.repository
with:
actions-path: actions
Expand All @@ -550,7 +550,7 @@ jobs:
packages: read
id-token: write # Needed for getting local workflow actions
steps:
- uses: hoverkraft-tech/ci-github-common/actions/checkout@4b53189212d5810f710bed89711002626977215b # 0.33.0
- uses: hoverkraft-tech/ci-github-common/actions/checkout@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
if: inputs.container == ''

- if: needs.build.outputs.artifact-id && inputs.container == ''
Expand All @@ -560,12 +560,12 @@ jobs:
path: "/"

- id: local-workflow-actions
uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
with:
actions-path: actions

- id: prepare-test-options
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
TEST_INPUT: ${{ inputs.test }}
with:
Expand Down Expand Up @@ -602,7 +602,7 @@ jobs:
github-token: ${{ secrets.github-token || github.token }}

# jscpd:ignore-start
- uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@4b53189212d5810f710bed89711002626977215b # 0.33.0
- uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
if: always() && steps.local-workflow-actions.outputs.repository
with:
actions-path: actions
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/node_modules
/tests/*/node_modules
/tests/*/pnpm-workspace.yaml
/tests/*/coverage
/dist
/tests/yarn/package-lock.json
/dist
.pnpm-store
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,61 @@ lint-fix: ## Execute linting and fix
-e FIX_MARKDOWN_PRETTIER=true \
-e FIX_NATURAL_LANGUAGE=true)

deps-audit-fix: ## Execute dependency audit fix
@set -u; \
overall_status=0; \
packages="$$(find tests -type f -name package.json -not -path '*/node_modules/*' -print | sort)"; \
echo "Running dependency audit/fix for package.json files under tests/ ..."; \
for pkg in $$packages; do \
pkg_dir="$$(dirname "$$pkg")"; \
pm_field="$$(sed -n 's/.*"packageManager"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$$pkg" | head -n 1)"; \
pm=""; \
case "$$pm_field" in \
pnpm@*) pm="pnpm" ;; \
yarn@*) pm="yarn" ;; \
npm@*) pm="npm" ;; \
*) \
if [ -f "$$pkg_dir/pnpm-lock.yaml" ]; then \
pm="pnpm"; \
elif [ -f "$$pkg_dir/yarn.lock" ]; then \
pm="yarn"; \
else \
pm="npm"; \
fi; \
;; \
esac; \
echo "---"; \
echo "Detected $$pm in $$pkg_dir"; \
case "$$pm" in \
npm) \
(cd "$$pkg_dir" && npm install); \
echo "npm audit fix in $$pkg_dir"; \
if ! (cd "$$pkg_dir" && npm audit fix); then \
overall_status=1; \
fi; \
;; \
pnpm) \
(cd "$$pkg_dir" && corepack pnpm install); \
echo "pnpm audit --fix in $$pkg_dir"; \
if ! (cd "$$pkg_dir" && corepack pnpm audit --fix); then \
overall_status=1; \
fi; \
;; \
yarn) \
(cd "$$pkg_dir" && corepack yarn install); \
echo "yarn audit in $$pkg_dir"; \
if ! (cd "$$pkg_dir" && corepack yarn audit); then \
overall_status=1; \
fi; \
;; \
esac; \
done; \
exit $$overall_status

ci: ## Execute CI tasks
$(MAKE) deps-audit-fix || true
$(MAKE) lint-fix

define run_linter
DEFAULT_WORKSPACE="$(CURDIR)"; \
LINTER_IMAGE="linter:latest"; \
Expand Down
23 changes: 9 additions & 14 deletions actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ outputs:
runs:
using: "composite"
steps:
- shell: bash
# FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684
run: mkdir -p ./self-build-action/ && cp -r $GITHUB_ACTION_PATH/../* ./self-build-action/
- uses: hoverkraft-tech/ci-github-common/actions/local-actions@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
with:
source-path: ${{ github.action_path }}/..

- id: working-directory
uses: hoverkraft-tech/ci-github-common/actions/working-directory@4b53189212d5810f710bed89711002626977215b # 0.33.0
uses: hoverkraft-tech/ci-github-common/actions/working-directory@71b85947453f32b5d147ff3ab37351439a92d840 # 0.34.2
with:
working-directory: ${{ inputs.working-directory }}
enforce-path-in-workspace: ${{ inputs.container && 'false' || 'true' }}

- id: setup-node
if: inputs.container != 'true'
uses: ./self-build-action/setup-node
uses: ./../self-actions/setup-node
with:
working-directory: ${{ steps.working-directory.outputs.absolute-path }}
dependencies-cache: |
Expand All @@ -90,11 +90,11 @@ runs:

- id: get-package-manager
if: inputs.container == 'true'
uses: ./self-build-action/get-package-manager
uses: ./../self-actions/get-package-manager
with:
working-directory: ${{ steps.working-directory.outputs.absolute-path }}

- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
BUILD_ENV: ${{ inputs.build-env }}
BUILD_SECRETS: ${{ inputs.build-secrets }}
Expand Down Expand Up @@ -124,7 +124,7 @@ runs:
core.exportVariable(key.trim(), value.trim());
}

- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
BUILD_COMMANDS: ${{ inputs.build-commands }}
RUN_SCRIPT_COMMAND: ${{ inputs.container == 'true' && steps.get-package-manager.outputs.run-script-command || steps.setup-node.outputs.run-script-command }}
Expand Down Expand Up @@ -163,14 +163,9 @@ runs:

- id: build-artifact-id
if: inputs.build-artifact != ''
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ fromJSON(inputs.build-artifact).name }}
path: ${{ fromJSON(inputs.build-artifact).paths }}
if-no-files-found: error
include-hidden-files: true

# FIXME: workaround until will be merged: https://github.com/actions/runner/pull/1684
- shell: bash
if: always()
run: rm -fr ./self-build-action
Loading
Loading