Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created April 9, 2021 07:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/3fd8d9bdc9ecde473244de40da2fecf0 to your computer and use it in GitHub Desktop.
Save xuwei-k/3fd8d9bdc9ecde473244de40da2fecf0 to your computer and use it in GitHub Desktop.
GitHub Actionsで祝日だったらcron実行をskipするサンプル
on:
schedule:
- cron: '0 0 * * *'
jobs:
scala-steward:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm install @holiday-jp/holiday_jp
- uses: actions/github-script@v3
id: is_holiday
with:
script: |
const holiday_jp = require(`${process.env.GITHUB_WORKSPACE}/node_modules/@holiday-jp/holiday_jp`)
core.setOutput('holiday', holiday_jp.isHoliday(new Date()));
- uses: scala-steward-org/scala-steward-action@v2
if: "${{ steps.is_holiday.outputs.holiday != 'true' }}"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment