Skip to content

Commit 089b49e

Browse files
onboarding setup-jfrog-cli
build updated subscription check added workflow updated workflow updated workflow updated
1 parent 0093e03 commit 089b49e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+107068
-1
lines changed

.eslintrc.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint'],
5+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
6+
rules: {
7+
'@typescript-eslint/typedef': [
8+
'error',
9+
{
10+
memberVariableDeclaration: true,
11+
variableDeclaration: true,
12+
objectDestructuring: true,
13+
propertyDeclaration: true,
14+
parameter: true
15+
}
16+
],
17+
'prefer-const': 'off',
18+
'no-extra-boolean-cast': 'off',
19+
'@typescript-eslint/no-inferrable-types': 'off',
20+
'@typescript-eslint/no-explicit-any': 'off'
21+
},
22+
overrides: [
23+
{
24+
files: ['*.test.ts'],
25+
rules: {
26+
'@typescript-eslint/no-non-null-assertion': 'off'
27+
}
28+
}
29+
]
30+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
release:
15+
permissions:
16+
actions: read
17+
id-token: write
18+
contents: write
19+
20+
uses: step-security/reusable-workflows/.github/workflows/actions_release.yaml@v1
21+
with:
22+
tag: "${{ github.event.inputs.tag }}"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
schedule:
15+
- cron: "0 0 * * 1"
16+
17+
jobs:
18+
audit-fix:
19+
uses: step-security/reusable-workflows/.github/workflows/audit_fix.yml@v1
20+
with:
21+
force: ${{ inputs.force || false }}
22+
base_branch: ${{ inputs.base_branch || 'main' }}
23+
24+
permissions:
25+
contents: write
26+
pull-requests: write
27+
packages: read
28+
issues: write
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Auto Cherry-Pick from Upstream
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
base_branch:
7+
description: "Base branch to create the PR against"
8+
required: true
9+
default: "main"
10+
mode:
11+
description: "Run mode: cherry-pick or verify"
12+
required: false
13+
default: "cherry-pick"
14+
15+
pull_request:
16+
types: [opened, synchronize, labeled]
17+
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
packages: read
22+
issues: write
23+
24+
jobs:
25+
cherry-pick:
26+
uses: step-security/reusable-workflows/.github/workflows/auto_cherry_pick.yaml@v1
27+
if: github.event_name == 'workflow_dispatch' || contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'review-required')
28+
with:
29+
original-owner: "jfrog"
30+
repo-name: "setup-jfrog-cli"
31+
base_branch: ${{ inputs.base_branch }}
32+
mode: ${{ github.event_name == 'pull_request' && 'verify' || inputs.mode }}
33+

.github/workflows/guarddog.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Run GuardDog Scan on PRs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
call-guarddog-scan:
14+
uses: step-security/reusable-workflows/.github/workflows/guarddog.yml@v1

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "Test"
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
pull_request:
7+
jobs:
8+
test:
9+
name: Test (${{ matrix.os }}) - (CLI ${{ matrix.cli-version || 'default' }})
10+
runs-on: ${{ matrix.os }}
11+
12+
strategy:
13+
matrix:
14+
os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu-latest"]') || fromJSON('["ubuntu-latest", "macos-13", "windows-latest"]') }}
15+
cli-version: [ "", "latest", "1.46.4" ]
16+
fail-fast: false
17+
steps:
18+
# Checkout and install prerequisites
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
- name: Setup NodeJS
22+
uses: actions/setup-node@v6
23+
with:
24+
node-version: "20.x"
25+
26+
# Run action according to the input version
27+
- name: Setup JFrog CLI
28+
if: matrix.cli-version != ''
29+
uses: ./
30+
with:
31+
version: ${{ matrix.cli-version }}
32+
- name: Setup default JFrog CLI
33+
if: matrix.cli-version == ''
34+
uses: ./
35+
36+
# Run --version
37+
- name: Check versions
38+
run: jf --version && jfrog --version
39+
40+
# Check local server successfully configured
41+
- name: Sanity
42+
run: jf c show local || jfrog rt config show local
43+
44+
# Check build URL
45+
- name: Check build URL
46+
run: curl -I "$JFROG_CLI_BUILD_URL"
47+
shell: bash
48+
49+
# Check environment variables
50+
- name: Check action environment
51+
run: node scripts/check-env.js
52+
53+
# Install and run tests
54+
- name: Install
55+
run: npm i
56+
- name: Unit tests
57+
run: npm t

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# IDEs
2+
.idea
3+
.vscode
4+
*.iml
5+
6+
node_modules
7+
__tests__/runner/*
8+
9+
lib
10+
11+
# Vim
12+
*~
13+
*.swp
14+
15+
# IOS
16+
*.DS_Store

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 150,
3+
"singleQuote": true,
4+
"tabWidth": 4
5+
}

0 commit comments

Comments
 (0)