LoginSignup
1
0

More than 1 year has passed since last update.

【GitHub Actions】平日のみ実行する

Last updated at Posted at 2022-07-31

概要

GitHub Actionsの実行スケジュールでは分、時、日、月に加えて曜日まで指定することができる。
平日のみ実行する場合の記載方法を以下に記す。

書き方

cron構文では以下のようにスケジュールを指定する。

┌────────────── 分 (0 - 59)
│ ┌───────────── 時間 (0 - 23)
│ │ ┌───────────── 日 (1 - 31)
│ │ │ ┌───────────── 月 (1 - 12)
│ │ │ │ ┌───────────── 曜日 (0 - 6) (日曜日から土曜日)
│ │ │ │ │
│ │ │ │ │
│ │ │ │ │
* * * * * 

平日のみ実行の場合は以下。

on:
  schedule:
    cron:
      - '0 0 * * 1-5'

日本時間で実行日時を指定するときは時差(約9時間)を考慮する必要がある。
上記の例では平日9時に実行されるが、例えば平日8時に実行したい場合は曜日の指定を0-4(日~木)にする等の調整が必要なので注意。

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