Skip to content

Commit

Permalink
Merge pull request #1 from step-security/release
Browse files Browse the repository at this point in the history
chore: initial release
  • Loading branch information
shubham-stepsecurity authored Nov 26, 2024
2 parents 82512e4 + c5dc5f6 commit 5d5c7ee
Show file tree
Hide file tree
Showing 26 changed files with 238,494 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.js,*.ts]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
tab_width = 4

[*.gitattributes]
indent_style = tab
tab_width = 16
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
/dist/index.js binary
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
21 changes: 21 additions & 0 deletions .github/workflows/actions_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release GitHub Actions

on:
workflow_dispatch:
inputs:
tag:
description: "Tag for the release"
required: true

permissions:
contents: read

jobs:
release:
permissions:
actions: read
id-token: write
contents: write
uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
with:
tag: "${{ github.event.inputs.tag }}"
177 changes: 177 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
name: Test Action

on:
- push
- pull_request
- workflow_dispatch

jobs:
test_default_inputs:
name: Test with default inputs

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
pnpm:
- 4.11.1
os:
- ubuntu-latest
- macos-latest
- windows-latest

steps:
- uses: actions/checkout@v4

- name: Run the action
uses: ./
with:
version: 4.11.1

- name: 'Test: which'
run: which pnpm; which pnpx

- name: 'Test: install'
run: pnpm install

test_dest:
name: Test with dest

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
pnpm:
- 4.11.1
os:
- ubuntu-latest
- macos-latest
- windows-latest

steps:
- uses: actions/checkout@v4

- name: Run the action
uses: ./
with:
version: 4.11.1
dest: ~/test/pnpm

- name: 'Test: which'
run: which pnpm && which pnpx

- name: 'Test: install'
run: pnpm install

test_standalone:
name: Test with standalone

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest

standalone:
- true
- false

steps:
- uses: actions/checkout@v4

- name: Run the action
uses: ./
with:
version: 7.0.0
standalone: ${{ matrix.standalone }}

- name: install Node.js
uses: actions/setup-node@v4
with:
# [email protected] is not compatible with Node.js 12
node-version: 20

- name: 'Test: which (pnpm)'
run: which pnpm

- name: 'Test: which (pnpx)'
if: matrix.standalone == false
run: which pnpx

- name: 'Test: install when standalone is true'
if: matrix.standalone
run: pnpm install

- name: 'Test: install when standalone is false'
if: matrix.standalone == false
# Since the default shell on windows runner is pwsh, we specify bash explicitly
shell: bash
run: |
if pnpm install; then
echo "pnpm install should fail"
exit 1
else
echo "pnpm install failed as expected"
fi
test_run_install:
name: 'Test with run_install (${{ matrix.run_install.name }}, ${{ matrix.os }})'

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
pnpm:
- 4.11.1
os:
- ubuntu-latest
- macos-latest
- windows-latest
run_install:
- name: 'null'
value: 'null'
- name: 'empty object'
value: '{}'
- name: 'recursive'
value: |
recursive: true
- name: 'global'
value: |
args:
- --global
- --global-dir=./pnpm-global
- npm
- yarn
- pnpm
- name: 'array'
value: |
- {}
- recursive: true
- args:
- --global
- --global-dir=./pnpm-global
- npm
- yarn
- pnpm
steps:
- uses: actions/checkout@v4

- name: Run the action
uses: ./
with:
version: 4.11.1
run_install: ${{ matrix.run_install.value }}

- name: 'Test: which'
run: which pnpm; which pnpx

- name: 'Test: install'
run: pnpm install
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules
*.log
/dist/*
!/dist/index.js
!/dist/pnpm.cjs
!/dist/worker.js
tmp
temp
*.tmp
*.temp
tmp.*
temp.*
.pnpm-store
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2023 StepSecurity
Copyright © 2020 Hoàng Văn Khải

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit 5d5c7ee

Please sign in to comment.