Skip to content

Commit

Permalink
feat: add setup action for use in GitHub workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Jakob Steiner <jakob.steiner@glasskube.eu>
  • Loading branch information
kosmoz committed Mar 4, 2024
1 parent 0e29a94 commit 72676df
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test actions/setup

on:
push:
paths:
- actions/**

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: read
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Setup scout
uses: ./actions/setup
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: scout --version
9 changes: 9 additions & 0 deletions actions/setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Scout Setup Action

This is a GitHub Workflow Action to setup @glasskube/scout.

## Inputs

- `token` (required): The GitHub Token used to authenticate against the GitHub package registry.
You can use ${{ secrets.GITHUB_TOKEN }} or a custom personal access token.
It needs permission to read public packages from the GitHub package registry.
21 changes: 21 additions & 0 deletions actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Setup @glasskube/scout
description: Install @glasskube/scout globally using npm
inputs:
token:
required: true
description: GitHub Token for NPM registry
outputs: {}
runs:
using: "composite"
steps:
- name: Setup node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: "20"
registry-url: "https://npm.pkg.github.com"
scope: "@glasskube"
- name: Install scout
shell: sh
run: npm install --global @glasskube/scout@0.1.0 # x-release-please-version
env:
NODE_AUTH_TOKEN: ${{ inputs.token }}
7 changes: 5 additions & 2 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
"bump-patch-for-minor-pre-major": true,
"draft": false,
"prerelease": false,
"include-component-in-tag": false
"include-component-in-tag": false,
"extra-files": [
"actions/setup/action.yaml"
]
}
},
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}
}

0 comments on commit 72676df

Please sign in to comment.