github-action-config-helper 2.1.10
Install from the command line:
Learn more about npm packages
$ npm install @technote-space/github-action-config-helper@2.1.10
Install via package.json:
"@technote-space/github-action-config-helper": "2.1.10"
About this version
Read this in other languages: English, 日本語.
アクション実行中のリポジトリから設定を取得する GitHub Actions のヘルパー
Details
- インストール
npm i @technote-space/github-action-config-helper
import { getConfig } from '@technote-space/github-action-config-helper';
import { getInput } from '@actions/core';
import { context, GitHub } from '@actions/github';
...
const config = await getConfig('config.yml', new GitHub(getInput('GITHUB_TOKEN', {required: true})), context);
//const config = await getConfig('config.json', new GitHub(getInput('GITHUB_TOKEN', {required: true})), context, {ref: 'feature/change'}); // branch
//const config = await getConfig('config', new GitHub(getInput('GITHUB_TOKEN', {required: true})), context, {ref: 'v1.2.3'}); // tag
//const config = await getConfig('config.yml', new GitHub(getInput('GITHUB_TOKEN', {required: true})), context, {configPath: ''}); // default: '.github'
.yml
.yaml
その他の拡張子
e.g.
config.json
.eslintrc