koumatsumoto / github-composite-action-template-2023

The repository template for new GitHub Composite Actions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<REPOSITORY_NAME>

テンプレートリポジトリとして作成した場合

以下のコマンドでリポジトリ名を一括置換する。

REPOSITORY_NAME=
sed -i "s/<REPOSITORY_NAME>/$REPOSITORY_NAME/" ./README.md ./action.yml

使い方

サンプルコード

- uses: <REPOSITORY_NAME>@v1
  id: result
  with:
    input_value: "hello"

- run: |
    echo "${{ steps.result.outputs.output_value }}"

ローカル環境構築

開発する上で、事前に以下のツールをインストールする。

  1. Node.js
  2. Docker
  3. act

1. Node.js

Prettierを使うためにNode.jsをインストールしておく。

node -v  # v20.2.0
npm -v   # 9.6.6
npx prettier . --write

2. Docker

actの依存として必要なので事前にインストールしておく。

docker -v  # Docker version 24.0.4, build 3713ee1

3. act

GitHub Actionsをローカル環境でテストするためのツール。 インストール手順はこちらを参照。 https://github.com/nektos/act

act --version  # act version 0.2.48

テスト

以下のコマンドで、ローカル環境で開発したGitHub Actionsをテストできる。

act

actの使い方については以下を参照。 https://github.com/nektos/act#example-commands

About

The repository template for new GitHub Composite Actions

License:Apache License 2.0


Languages

Language:Shell 100.0%