2
0

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 1 year has passed since last update.

【GitHub Actions】プルリクエスト作成時にCIが流れるか確認

Posted at

はじめに

GitHub にてプルリクエスト作成時に GitHub Actions のCIが流れるかテストをしたので記事としてアウトプットをしたいと思います。

イメージ図

CI CD-CI.drawio.png

前提

  • GitHub上に既にリポジトリが存在する状態
  • GitHub上にGitからPushできる環境が整っている状態

作業手順

  • .github/workflows直下に以下のファイルを配置します。
sample.yml
name: Action Sample

on:
  pull_request:
    types: [opened]

jobs:
  print-hello-world:
    runs-on: ubuntu-latest
    steps:
      - name: execute echo command
        run: echo "Hello World!"

今回は、Hello World!と表示させるだけの処理になります。

  • GitHub上にコードをPushすると、以下のように自動で処理が流れる。

スクリーンショット 2023-01-11 1.08.12.png

出力
Run echo "Hello World!"
  echo "Hello World!"
  shell: /usr/bin/bash -e {0}
Hello World!

参考

2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?