Skip to content

Commit 86f1ebd

Browse files
authored
Merge pull request #2 from step-security/release
feat: initial release
2 parents 4940083 + 68687e4 commit 86f1ebd

138 files changed

Lines changed: 19914 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release GitHub Actions
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag for the release"
8+
required: true
9+
node_version:
10+
description: "Node.js version to use"
11+
required: false
12+
default: "24"
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
release:
19+
permissions:
20+
actions: read
21+
id-token: write
22+
contents: write
23+
24+
uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
25+
with:
26+
tag: "${{ github.event.inputs.tag }}"
27+
node_version: ${{ inputs.node_version || '24' }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: NPM Audit Fix Run
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
force:
7+
description: "Use --force flag for npm audit fix?"
8+
required: true
9+
type: boolean
10+
base_branch:
11+
description: "Specify a base branch"
12+
required: false
13+
default: "main"
14+
node_version:
15+
description: "Node.js version to use"
16+
required: false
17+
default: "24"
18+
schedule:
19+
- cron: "0 0 * * 1"
20+
21+
jobs:
22+
audit-fix:
23+
uses: step-security/reusable-workflows/.github/workflows/audit_fix.yml@v1
24+
with:
25+
force: ${{ inputs.force || false }}
26+
base_branch: ${{ inputs.base_branch || 'main' }}
27+
node_version: ${{ inputs.node_version || '24' }}
28+
permissions:
29+
contents: write
30+
pull-requests: write
31+
packages: read
32+
issues: write
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Auto Cherry-Pick from Upstream
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Release GitHub Actions"]
6+
types:
7+
- completed
8+
9+
workflow_dispatch:
10+
inputs:
11+
base_branch:
12+
description: "Base branch to create the PR against"
13+
required: true
14+
default: "main"
15+
mode:
16+
description: "Run mode: cherry-pick or verify"
17+
required: false
18+
default: "cherry-pick"
19+
node_version:
20+
description: "Node.js version to use"
21+
required: false
22+
default: "24"
23+
24+
pull_request:
25+
types: [opened, synchronize, labeled]
26+
27+
permissions:
28+
contents: write
29+
pull-requests: write
30+
packages: read
31+
issues: write
32+
33+
jobs:
34+
cherry-pick:
35+
if: (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')
36+
uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@v1
37+
with:
38+
original-owner: "shivammathur"
39+
repo-name: "setup-php"
40+
base_branch: ${{ inputs.base_branch || 'main' }}
41+
mode: ${{ github.event_name == 'pull_request' && 'verify' || inputs.mode || 'cherry-pick' }}
42+
node_version: ${{ inputs.node_version || '24' }}

‎.github/workflows/node.yml‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Node workflow
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
paths-ignore:
7+
- '**.md'
8+
- 'examples/**'
9+
push:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- '**.md'
14+
- 'examples/**'
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
run:
20+
name: Run
21+
runs-on: ${{ matrix.operating-system }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
operating-system: ${{ github.actor == 'dependabot[bot]' && fromJson('["ubuntu-latest"]') || fromJson('["ubuntu-latest", "windows-latest", "macos-latest"]') }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v6
29+
with:
30+
fetch-depth: 2
31+
32+
- name: Setup Node.js 24.x
33+
uses: actions/setup-node@v6
34+
with:
35+
node-version: 24.x
36+
37+
- name: Install dependencies
38+
run: npm install
39+
40+
- name: Prettier Format Check
41+
run: npm run format-check
42+
43+
- name: ESLint Check
44+
run: npm run lint
45+
46+
- name: Run tests
47+
run: npm test

‎.github/workflows/php.yml‎

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Main workflow
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**.md'
9+
- 'examples/**'
10+
push:
11+
branches:
12+
- main
13+
paths-ignore:
14+
- '**.md'
15+
- 'examples/**'
16+
permissions:
17+
contents: read
18+
env:
19+
default-php-version: '8.2'
20+
jobs:
21+
run:
22+
name: Run
23+
runs-on: ${{ matrix.operating-system }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
operating-system: ${{ github.actor == 'dependabot[bot]' && fromJson('["ubuntu-24.04"]') || fromJson('["ubuntu-24.04", "ubuntu-22.04", "windows-2022", "macos-15-intel"]') }}
28+
php-versions: ${{ github.actor == 'dependabot[bot]' && fromJson('["8.6"]') || fromJson('["5.3", "5.4", "5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5", "8.6"]') }}
29+
include:
30+
- operating-system: ubuntu-24.04
31+
php-versions: ''
32+
php-version-file: 'php-version-file'
33+
env:
34+
extensions: xml, opcache, xdebug, pcov, gd
35+
key: cache-v5
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v6
39+
40+
- name: Setup cache environment
41+
id: cache-env
42+
uses: shivammathur/cache-extensions@v1
43+
with:
44+
php-version: ${{ matrix.php-versions || env.default-php-version }}
45+
extensions: ${{ env.extensions }}
46+
key: ${{ env.key }}
47+
48+
- name: Cache extensions
49+
uses: actions/cache@v5
50+
with:
51+
path: ${{ steps.cache-env.outputs.dir }}
52+
key: ${{ steps.cache-env.outputs.key }}
53+
restore-keys: ${{ steps.cache-env.outputs.key }}
54+
55+
- name: Stage php-version-file
56+
if: ${{ matrix.php-version-file == 'php-version-file' }}
57+
run: |
58+
echo ${{ env.default-php-version }} > php-version-file
59+
60+
- name: Setup PHP with extensions and custom config
61+
run: node dist/index.js
62+
env:
63+
php-version: ${{ matrix.php-versions }}
64+
php-version-file: ${{ matrix.php-version-file }}
65+
extensions: ${{ env.extensions }}
66+
ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata
67+
68+
- name: Testing PHP version
69+
run: |
70+
php -v
71+
php -r "if(strpos(phpversion(), '${{ matrix.php-versions || env.default-php-version }}') === false) {throw new Exception('Wrong PHP version Installed');}"
72+
73+
- name: Testing Composer version
74+
run: |
75+
composer -V
76+
php -r "if(strpos(@exec('composer -V'), 'Composer version') === false) {throw new Exception('Composer not found');}"
77+
- name: Testing Extensions
78+
run: |
79+
php -m
80+
php -r "if(! extension_loaded('gd')) {throw new Exception('gd not found');}"
81+
php -r "if(! extension_loaded('xml')) {throw new Exception('xml not found');}"
82+
php -r "if(! extension_loaded('Xdebug')) {throw new Exception('Xdebug not found');}"
83+
php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}"
84+
- name: Testing ini values
85+
run: |
86+
php -r "if(ini_get('memory_limit')!='-1') {throw new Exception('memory_limit not disabled');}"
87+
php -r "if(ini_get('post_max_size')!='256M') {throw new Exception('post_max_size not added');}"
88+
php -r "if(ini_get('short_open_tag')!=1) {throw new Exception('short_open_tag not added');}"
89+
php -r "if(ini_get('date.timezone')!='Asia/Kolkata') {throw new Exception('date.timezone not added');}"

‎.gitignore‎

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Explicitly not ignoring node_modules so that they are included in package downloaded by runner
2+
node_modules/
3+
__tests__/runner/*
4+
lib/
5+
6+
# Rest of the file pulled from https://github.com/github/gitignore/blob/main/Node.gitignore
7+
# Logs
8+
logs
9+
*.log
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
lerna-debug.log*
14+
15+
# Diagnostic reports (https://nodejs.org/api/report.html)
16+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
17+
18+
# Runtime data
19+
pids
20+
*.pid
21+
*.seed
22+
*.pid.lock
23+
24+
# Directory for instrumented libs generated by jscoverage/JSCover
25+
lib-cov
26+
27+
# Coverage directory used by tools like istanbul
28+
coverage
29+
*.lcov
30+
31+
# nyc test coverage
32+
.nyc_output
33+
34+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
35+
.grunt
36+
37+
# Bower dependency directory (https://bower.io/)
38+
bower_components
39+
40+
# node-waf configuration
41+
.lock-wscript
42+
43+
# Compiled binary addons (https://nodejs.org/api/addons.html)
44+
build/Release
45+
46+
# Dependency directories
47+
jspm_packages/
48+
49+
# TypeScript v1 declaration files
50+
typings/
51+
52+
# TypeScript cache
53+
*.tsbuildinfo
54+
55+
# Optional npm cache directory
56+
.npm
57+
58+
# Optional eslint cache
59+
.eslintcache
60+
61+
# Optional REPL history
62+
.node_repl_history
63+
64+
# Output of 'npm pack'
65+
*.tgz
66+
67+
# Yarn Integrity file
68+
.yarn-integrity
69+
70+
# dotenv environment variables file
71+
.env
72+
.env.test
73+
74+
# parcel-bundler cache (https://parceljs.org/)
75+
.cache
76+
77+
# next.js build output
78+
.next
79+
80+
# nuxt.js build output
81+
.nuxt
82+
83+
# vuepress build output
84+
.vuepress/dist
85+
86+
# Serverless directories
87+
.serverless/
88+
89+
# FuseBox cache
90+
.fusebox/
91+
92+
# DynamoDB Local files
93+
.dynamodb/

‎.node-version‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

‎.npmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
min-release-age=3

‎.prettierrc.json‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"arrowParens": "avoid",
3+
"bracketSpacing": false,
4+
"endOfLine": "auto",
5+
"parser": "typescript",
6+
"printWidth": 80,
7+
"semi": true,
8+
"singleQuote": true,
9+
"tabWidth": 2,
10+
"trailingComma": "none",
11+
"useTabs": false
12+
}

‎LICENSE‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) shivammathur and contributors
4+
Copyright (c) 2026 Step Security, Inc.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

0 commit comments

Comments
 (0)