https://github.com/technote-space/github-action-config-helper
Helper for GitHub Actions to get config from the repository where the action is running.
https://github.com/technote-space/github-action-config-helper
github-actions
Last synced: 4 months ago
JSON representation
Helper for GitHub Actions to get config from the repository where the action is running.
- Host: GitHub
- URL: https://github.com/technote-space/github-action-config-helper
- Owner: technote-space
- License: mit
- Created: 2019-09-22T04:50:14.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-12-29T09:05:36.000Z (almost 2 years ago)
- Last Synced: 2025-08-08T23:00:57.061Z (4 months ago)
- Topics: github-actions
- Language: TypeScript
- Homepage:
- Size: 2.83 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.ja.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# GitHub Action Config Helper
[](https://badge.fury.io/js/%40technote-space%2Fgithub-action-config-helper)
[](https://github.com/technote-space/github-action-config-helper/actions)
[](https://codecov.io/gh/technote-space/github-action-config-helper)
[](https://www.codefactor.io/repository/github/technote-space/github-action-config-helper)
[](https://github.com/technote-space/github-action-config-helper/blob/master/LICENSE)
*Read this in other languages: [English](README.md), [日本語](README.ja.md).*
アクション実行中のリポジトリから設定を取得する GitHub Actions のヘルパー
## Table of Contents
Details
- [使用方法](#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)
- [サポートされているファイルの種類](#%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E7%A8%AE%E9%A1%9E)
- [YAML](#yaml)
- [JSON](#json)
- [Author](#author)
## 使用方法
1. インストール
`npm i @technote-space/github-action-config-helper`
1.
```js
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'
```
## サポートされているファイルの種類
### YAML
- `.yml`
- `.yaml`
### JSON
その他の拡張子
e.g.
- `config.json`
- `.eslintrc`
## Author
[GitHub (Technote)](https://github.com/technote-space)
[Blog](https://technote.space)