0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

リポジトリ内で自作した GitHub Actions を直接実行する

Last updated at Posted at 2020-07-30

使うタイミング

  • 公開アクションのテストを行いたいとき
  • プライベートリポジトリでアクションを自作して実行したいとき

やり方

実行したいアクションの準備

GitHub Action を実行するために、設定ファイルと実行ファイル(Javascript or Docker)を用意する。

action.yml

Javascript アクション設定ファイルの例

name: "sample"
runs:
  using: "node12"
  main: "dist/index.js"

アクション実行用の設定を書く

注意点

  • 自作アクションの実行前に actions/checkout@v2 を実行しておく
  • usesaction.yml のディレクトリを指定することで実行できる

.github/workflows/sample.yml

name: Sample
on:
  push

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Sample
      uses: ./

ひとこと

できないと思って、Publish, 試す, バグ発見, HotFix, Publish... と無限に無駄なことやってた…

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?