xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

How to fix the inaccurate bug of UTC time set by GitHub scheduled tasks All In One

How to fix the inaccurate bug of UTC time set by GitHub scheduled tasks All In One

如何修复 GitHub 定时任务设置的 UTC 时间执行不准确 bug All In One

GitHub Actions 打卡机器人 🤖️

# This is a basic workflow to help you get started with Actions

name: WX_ROBOT

# Controls when the action will run. 
on:
  # Triggers the workflow on push events but only for the main branch
  push:
    branches: [ main ]
  schedule:
    # 每天下午 4:00 定时发送打卡提醒
    - cron: '00 00-16/1 * * *'

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  hello-job:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      # Runs a single command using the runners shell
      - name: Run a one-line script
        run: echo Hello, world!

solution

使用第三方的 cron 调度服务,触发执行 GitHub 定时任务

You can configure your workflows to run when specific activity on GitHub happens, at a scheduled time, or when an event outside of GitHub occurs.

您可以将工作流程配置为在 GitHub 上发生特定活动、在计划时间或在 GitHub 外部发生事件时运行。

# todo

on:
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'
        required: true
        default: 'warning'
        type: choice
        options:
        - info
        - warning
        - debug
      tags:
        description: 'Test scenario tags'
        required: false
        type: boolean
      environment:
        description: 'Environment to run tests against'
        type: environment
        required: true

jobs:
  log-the-inputs:
    runs-on: ubuntu-latest
    steps:
      - run: |
          echo "Log level: $LEVEL"
          echo "Tags: $TAGS"
          echo "Environment: $ENVIRONMENT"
        env:
          LEVEL: ${{ inputs.logLevel }}
          TAGS: ${{ inputs.tags }}
          ENVIRONMENT: ${{ inputs.environment }}
$ gh workflow run run-tests.yml -f logLevel=warning -f tags=false -f environment=staging

https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows

demos

⏰ 2021-11-25 14:25:39
🎉读书会快捷链接
📘打卡链接
👨🏻‍💻我的链接
💰积分链接
读书会机器人🤖️ features:
1. 大大简化进入打卡的流程,跳过 3s 首页的推荐;
2. 每天早晚两次打卡提醒(16:00) ⏰,降低忘记打卡的风险;

⏰ 2021-11-26 15:20:10
🎉读书会快捷链接
📘打卡链接
👨🏻‍💻我的链接
💰积分链接
读书会机器人🤖️ features:
1. 大大简化进入打卡的流程,跳过 3s 首页的推荐;
2. 每天早晚两次打卡提醒(16:00) ⏰,降低忘记打卡的风险;

refs

https://gist.github.com/xgqfrms/ec53c4c74fb1d60a172c329bcaff9a45

https://zhuanlan.zhihu.com/p/379365305



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @   xgqfrms  阅读(242)  评论(1编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2020-11-27 上海护照办理流程
2020-11-27 vue-cli & plugin:vue/strongly-recommended bug
2020-11-27 知乎 bug
2020-11-27 Google YouTube 前端黑科技
2020-11-27 末日余晖 PC 版 下载
2020-11-27 Apple Support
2020-11-27 how to enable vue cli auto open the localhost url
点击右上角即可分享
微信分享提示