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
61 changes: 61 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# dotenv-linter:off IncorrectDelimiter

# Do not commit your actual .env file to Git! This may contain secrets or other
# private information.

# Enable/disable step debug logging (default: `false`). For local debugging, it
# may be useful to set it to `true`.
ACTIONS_STEP_DEBUG=true

# GitHub Actions inputs should follow `INPUT_<name>` format (case-sensitive).
# Hyphens should not be converted to underscores!
INPUT_MILLISECONDS=2400

# GitHub Actions default environment variables. These are set for every run of a
# workflow and can be used in your actions. Setting the value here will override
# any value set by the local-action tool.
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

# CI="true"
# GITHUB_ACTION=""
# GITHUB_ACTION_PATH=""
# GITHUB_ACTION_REPOSITORY=""
# GITHUB_ACTIONS=""
# GITHUB_ACTOR=""
# GITHUB_ACTOR_ID=""
# GITHUB_API_URL=""
# GITHUB_BASE_REF=""
# GITHUB_ENV=""
# GITHUB_EVENT_NAME=""
# GITHUB_EVENT_PATH=""
# GITHUB_GRAPHQL_URL=""
# GITHUB_HEAD_REF=""
# GITHUB_JOB=""
# GITHUB_OUTPUT=""
# GITHUB_PATH=""
# GITHUB_REF=""
# GITHUB_REF_NAME=""
# GITHUB_REF_PROTECTED=""
# GITHUB_REF_TYPE=""
# GITHUB_REPOSITORY=""
# GITHUB_REPOSITORY_ID=""
# GITHUB_REPOSITORY_OWNER=""
# GITHUB_REPOSITORY_OWNER_ID=""
# GITHUB_RETENTION_DAYS=""
# GITHUB_RUN_ATTEMPT=""
# GITHUB_RUN_ID=""
# GITHUB_RUN_NUMBER=""
# GITHUB_SERVER_URL=""
# GITHUB_SHA=""
# GITHUB_STEP_SUMMARY=""
# GITHUB_TRIGGERING_ACTOR=""
# GITHUB_WORKFLOW=""
# GITHUB_WORKFLOW_REF=""
# GITHUB_WORKFLOW_SHA=""
# GITHUB_WORKSPACE=""
# RUNNER_ARCH=""
# RUNNER_DEBUG=""
# RUNNER_NAME=""
# RUNNER_OS=""
RUNNER_TEMP=".local/tmp"
RUNNER_TOOL_CACHE=".local/cache"
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: jkroepke
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#### What this PR does / why we need it

#### Which issue this PR fixes

_(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format,
will close that issue when PR gets merged)_: fixes #

- fixes #

#### Special notes for your reviewer

#### Particularly user-facing changes

#### Checklist

Complete these before marking the PR as `ready to review`:

<!-- [Place an '[x]' (no spaces) in all applicable fields.] -->

- [ ] [DCO](https://github.com/prometheus-community/helm-charts/blob/main/CONTRIBUTING.md#sign-off-your-work)
signed
- [ ] The PR title has a summary of the changes
- [ ] The PR body has a summary to reflect any significant (and particularly
user-facing) changes introduced by this PR
23 changes: 23 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
changelog:
exclude:
labels:
- chore
categories:
- title: 💥 Breaking Changes
labels:
- 💥 breaking-change
- title: ✨ Exciting New Features
labels:
- ✨ enhancement
- title: 🐞 Bug Fixes
labels:
- 🐞 bug
- title: 🛠️ Dependencies
labels:
- 🛠️ dependencies
- title: 📖 Documentation
labels:
- 📖 docs
- title: Other Changes
labels:
- '*'
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
env:
RUNNER_DEBUG: 1

name: 'CI'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'

jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '22'
- run: |
npm install
npm run all
- run: |
git diff --exit-code ':!dist/index.js.map' ':!badges/coverage.svg'
test: # make sure the action works on a clean machine without building
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./
- name: Get the version
run: stackit --version
- uses: ./
with:
version: v0.30.0
- name: Get the version
run: stackit --version | grep 0.30.0
- uses: ./
with:
version: 0.28.0
- name: Get the version
run: stackit --version | grep 0.28.0
20 changes: 20 additions & 0 deletions .github/workflows/update-major-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Update Major Tag
on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: write

jobs:
set-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: |
TAG=${{ github.ref_name }}
TAG=${TAG%%.*}
git tag -f ${TAG}
git push --tags --force
99 changes: 99 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Dependency directory
node_modules

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.local

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# OS metadata
.DS_Store
Thumbs.db

# Ignore built ts files
__tests__/runner/*

.idea
16 changes: 16 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# See: https://prettier.io/docs/en/configuration

printWidth: 80
tabWidth: 2
useTabs: false
semi: false
singleQuote: true
quoteProps: as-needed
jsxSingleQuote: false
trailingComma: none
bracketSpacing: true
bracketSameLine: true
arrowParens: always
proseWrap: always
htmlWhitespaceSensitivity: css
endOfLine: lf
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
![build-test](https://github.com/jkroepke/setup-vals/workflows/build-test/badge.svg)

## Setup stackit-cli

GitHub Action for installing
[stackitcloud/stackit-cli](https://github.com/stackitcloud/stackit-cli)

Install a specific version of vals binary on the runner. Acceptable values are
latest or any semantic version string like v2.16.7 Use this action in workflow
to define which version of sops will be used.

```yaml
- name: Stackit Binary Installer
uses: jkroepke/setup-stackit-cli@v1
with:
version: '<version>' # default is latest stable
id: install
```

The cached vals binary path is prepended to the PATH environment variable as
well as stored in the vals-path output variable. Refer to the action metadata
file for details about all the inputs
[here](https://github.com/jkroepke/setup-stackit-cli/blob/master/action.yml).
10 changes: 10 additions & 0 deletions __fixtures__/core.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type * as core from '@actions/core'
import { jest } from '@jest/globals'

export const debug = jest.fn<typeof core.debug>()
export const error = jest.fn<typeof core.error>()
export const info = jest.fn<typeof core.info>()
export const getInput = jest.fn<typeof core.getInput>()
export const setOutput = jest.fn<typeof core.setOutput>()
export const setFailed = jest.fn<typeof core.setFailed>()
export const warning = jest.fn<typeof core.warning>()
41 changes: 41 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Unit tests for the action's main functionality, src/main.ts
*
* To mock dependencies in ESM, you can create fixtures that export mock
* functions and objects. For example, the core module is mocked in this test,
* so that the actual '@actions/core' module is not imported.
*/
import { jest } from '@jest/globals'
import * as core from '../__fixtures__/core.js'

// Mocks should be declared before the module being tested is imported.
jest.unstable_mockModule('@actions/core', () => core)

// The module being tested should be imported dynamically. This ensures that the
// mocks are used in place of any actual dependencies.
const { run } = await import('../src/main.js')

describe('main.ts', () => {
beforeEach(() => {
// Set the action's inputs as return values from core.getInput().
core.getInput.mockImplementation(() => '500')
})

afterEach(() => {
jest.resetAllMocks()
})

it('Run main', async () => {

Check warning on line 28 in __tests__/main.test.ts

View workflow job for this annotation

GitHub Actions / build

Test has no assertions
await run()

/*
// Verify the time output was set.
expect(core.setOutput).toHaveBeenNthCalledWith(
1,
'sops-path',
// Simple regex to match a time string in the format HH:MM:SS.
expect.stringMatching(/^sops/)
)
*/
})
})
18 changes: 18 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'vals tools installer'
description:
'Install a specific version of the vals binary. Acceptable values are latest
or any semantic version string like 0.14.0'
inputs:
version:
description: 'Version of stackit-cli'
required: true
default: 'latest'
outputs:
path:
description: 'Path to the cached stackit-cli binary'
branding:
icon: 'wind'
color: 'gray-dark'
runs:
using: node20
main: 'dist/index.js'
1 change: 1 addition & 0 deletions badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading