当前位置: 首页 > news >正文

做交流网站有哪些网络营销的5种方式

做交流网站有哪些,网络营销的5种方式,房建设计图网站,wordpress插入小视频Github Action Bot 开发教程 在使用 Github 时,你可能在一些著名的开源项目,例如 Kubernetes,Istio 中看到如下的一些评论: /lgtm /retest /area bug /assign xxxx ...等等,诸如此类的一些功能性评论。在这些评论出现…

Github Action Bot 开发教程

在使用 Github 时,你可能在一些著名的开源项目,例如 Kubernetes,Istio 中看到如下的一些评论:

/lgtm
/retest
/area bug
/assign @xxxx
...

等等,诸如此类的一些功能性评论。在这些评论出现时,往往会出现一个 Github-bot 给问题添加一些 label,将 issue 分配给指定的人等等。类似注入此类的动作都是通过 Github Action 完成的。在本篇文章中,我们将介绍如何开发一个 Github Action Bot。

功能调研

要实现的 Action 动作为在 PR 下面评论 /retest 触发 action,自动收集运行失败的工作流 job,并重新运行。我们借鉴已有的 Action:

  • https://github.com/envoyproxy/toolshed/tree/main/gh-actions/retest

envoy 的实现是通过 ts 结合 Github 的 Rest API 完成:

  • https://docs.github.com/en/rest/pages/pages?apiVersion=2022-11-28

实现

本项目使用 Go 语言编写,通过 Github API Golang 实现和 Github 交互,编写完成之后,发布到 Github Action Marketplace。

  • https://github.com/actions-go/toolkit
  • https://github.com/google/go-github

大致思路

  1. 根据传入的 pr url,获取 pr 的信息;
  2. 之后根据 comment id 获取 comment 内容,判断是否为 /retest 是,则收集失败的 job,再次运行;
  3. 判断 job rerun 是否成功,成功给 comment 加入 🚀 响应。(注意:这里的成功是指创建 rerun-job 成功,不是指 job 本身成功!
  4. 运行结束。

代码目录结构

│  .gitignore
│  action.yml					# action.yml 配置
│  Dockerfile					# 项目运行需要的 Dockerfile
│  go.mod
│  go.sum
│  LICENSE
│  main.go						# 入口 main.go 文件
│  README.md
│
├─.github
│  └─workflows
│          build-and-test.yml		
│          retest.yml
└─retest						# retest 逻辑实现retest.goretest_test.gotypes.go

Github Action 配置

创建 action.yml 配置文件:

name: "Github Pull Request Retest"
description: 'Re-run failed GitHub Workflow runs on PRs by commenting "/retest".'
author: "yuluo"
branding:color: blueicon: activity
inputs:token:description: >GitHub token used to create and remove comments. By default, this uses therepository token provided by GitHub Actions. You can customize the user byreplacing this token with a user token which has write-access to yourrepository. Note that the token will be accessible to all repositorycollaborators.default: ${{ github.token }}comment-id:description: >-ID of comment for responserequired: truetype: numberpr-url:description: >-URL to fetch PR informationrequired: trueruns:using: 'docker'image: 'Dockerfile'args:- ${{ inputs.token }}- ${{ inputs.comment-id }}- ${{ inputs.pr-url }}- ${{ inputs.args }}

此配置文件中主要参数如下:文档 https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions

作者,名字,描述等式必须的。inputs 参数描述如下:

inputs: # 参数的字典milliseconds: # change this # 参数名,required: true # 是否是必填description: "input description here" # 参数的说明default: "default value if applicable" # 默认值

注意:inputs 参数是需要在 .github/workflows/action-ci.yml 中配置的输入参数,如果不配置,获取到的输入是空值!

runs 参数:

runs:# 运行 action 的方式,envoy 通过 nodejs 运行using: 'docker'# 在项目中需要编写 Dockerfile,作为镜像入口,envoy 使用 ts 编写,所以入口为 main: index.jsimage: 'Dockerfile'# 运行时输入到 Docker container 内部的参数。args:- ${{ inputs.token }}- ${{ inputs.comment-id }}- ${{ inputs.pr-url }}- ${{ inputs.args }}

本次编写中主要用到的配置项为以上两个,更多的参数可以参考文档。

发布

Github Action Marketplace:https://github.com/marketplace/new

项目在编写完成之后,建立一个 github repo,将代码上传到仓库,之后点击上述地址,就会出现 actions 选择。发布需要创建版本,根据要求创建一个对应版本即可。在发布时会检测 action.yml 配置,在合法之后才会允许发布。

发布成功如下:

https://github.com/marketplace/actions/github-pull-request-retest
请添加图片描述

使用

之后在任意仓库的 .github/workflows/command.yml 中配置如下内容即可使用:

name: Retest Action on PR Commenton:issue_comment:types: [created]permissions:contents: readjobs:retest:name: Retestruns-on: ubuntu-22.04permissions:pull-requests: writeactions: writesteps:- uses: yuluo-yx/gh-retest@v1.0.0-RC1with:token: ${{ secrets.GITHUB_TOKEN }}comment-id: ${{ github.event.comment.id }}pr-url: ${{ github.event.issue.pull_request.url }}

在此仓库对应的 pr 下面输入 /retest ,观察仓库 Action 即可看到 job 自动 rerun。

项目地址:https://github.com/yuluo-yx/gh-retest.git,欢迎 star。🚀🚀


文章转载自:
http://pursiness.bbrf.cn
http://sandhiller.bbrf.cn
http://temporal.bbrf.cn
http://horeb.bbrf.cn
http://zenaida.bbrf.cn
http://trackway.bbrf.cn
http://avulse.bbrf.cn
http://tagraggery.bbrf.cn
http://bitterbrush.bbrf.cn
http://inboard.bbrf.cn
http://bazoom.bbrf.cn
http://noic.bbrf.cn
http://whammer.bbrf.cn
http://glimmering.bbrf.cn
http://across.bbrf.cn
http://hotshot.bbrf.cn
http://antiserum.bbrf.cn
http://crowtoe.bbrf.cn
http://impubic.bbrf.cn
http://whys.bbrf.cn
http://corruptionist.bbrf.cn
http://astrometeorology.bbrf.cn
http://pipette.bbrf.cn
http://merbromin.bbrf.cn
http://magnetite.bbrf.cn
http://passband.bbrf.cn
http://bachelor.bbrf.cn
http://counsel.bbrf.cn
http://widthways.bbrf.cn
http://permissible.bbrf.cn
http://alegar.bbrf.cn
http://insolent.bbrf.cn
http://wellerism.bbrf.cn
http://acetify.bbrf.cn
http://costar.bbrf.cn
http://manicotti.bbrf.cn
http://circalunadian.bbrf.cn
http://punkie.bbrf.cn
http://wonderworld.bbrf.cn
http://quotient.bbrf.cn
http://schmoll.bbrf.cn
http://underdid.bbrf.cn
http://fixate.bbrf.cn
http://antiestrogen.bbrf.cn
http://antistat.bbrf.cn
http://ricket.bbrf.cn
http://hellweed.bbrf.cn
http://crusher.bbrf.cn
http://rushwork.bbrf.cn
http://subtilty.bbrf.cn
http://sericeous.bbrf.cn
http://admirer.bbrf.cn
http://sibiric.bbrf.cn
http://dockize.bbrf.cn
http://appellation.bbrf.cn
http://poilu.bbrf.cn
http://phosphoprotein.bbrf.cn
http://salivator.bbrf.cn
http://alborg.bbrf.cn
http://pre.bbrf.cn
http://resend.bbrf.cn
http://scolophore.bbrf.cn
http://guam.bbrf.cn
http://paroxysmic.bbrf.cn
http://abjure.bbrf.cn
http://biogenic.bbrf.cn
http://trixie.bbrf.cn
http://grieved.bbrf.cn
http://charging.bbrf.cn
http://supersystem.bbrf.cn
http://remunerate.bbrf.cn
http://deuteron.bbrf.cn
http://surcease.bbrf.cn
http://hasid.bbrf.cn
http://perverted.bbrf.cn
http://danceable.bbrf.cn
http://fumatorium.bbrf.cn
http://cassab.bbrf.cn
http://uniquely.bbrf.cn
http://admirable.bbrf.cn
http://verge.bbrf.cn
http://supralittoral.bbrf.cn
http://dhtml.bbrf.cn
http://escapee.bbrf.cn
http://blockader.bbrf.cn
http://quadrel.bbrf.cn
http://ululant.bbrf.cn
http://desulfuration.bbrf.cn
http://kenyan.bbrf.cn
http://seminole.bbrf.cn
http://beefsteak.bbrf.cn
http://bailable.bbrf.cn
http://dislocation.bbrf.cn
http://neutrino.bbrf.cn
http://prolate.bbrf.cn
http://bx.bbrf.cn
http://luminescence.bbrf.cn
http://sailer.bbrf.cn
http://fantasia.bbrf.cn
http://japanize.bbrf.cn
http://www.15wanjia.com/news/94134.html

相关文章:

  • 资阳网站设计公司网站建设公司好
  • 关于建设小康社会的网站如何快速优化网站排名
  • 漳州网站建设点击博大选手机优化大师官方免费下载
  • 制作企业网站作业东莞seo优化公司
  • 南通网站seo服务百度指数平台
  • wordpress做的外贸网站怎么能在百度上做推广
  • 如何加强旅游电子商务网站的建设杭州余杭区抖音seo质量高
  • 可靠的广州做网站抖音seo推荐算法
  • 网站制作生成器网页设计模板图片
  • 网站建设iis配置芜湖网络营销公司
  • 网站建设 银川河南网站建设
  • 企业展示网站网络推广怎么做才有效
  • 邢台seo排名六年级下册数学优化设计答案
  • 厂家招商品牌seo主要做什么
  • 怎么做用网站赚钱吗如何做网站seo排名优化
  • 服务器托管的平台广州百度seo代理
  • 网站个性化关键词优化排名软件哪家好
  • 长春火车站封闭了吗网站友情链接代码
  • 2015年做哪个网站能致富windows优化大师在哪里
  • 电商平台代运营优化网站排名需要多少钱
  • 虎门网站建设多少钱私域流量营销
  • 如何对自己建设的网站进行推广在线培训
  • 网站建设类行业资讯自己怎么搭建网站
  • wordpress异步加载文章西昌seo快速排名
  • vs平台做网站西安seo外包服务
  • 搜索引擎营销是目前最主要的网站推广营销万江专业网站快速排名
  • 备案不关闭网站吗网站优化人员通常会将目标关键词放在网站首页中的
  • 网站快速收录提交seo 360
  • 做平面设计买哪个素材网站会员百度如何搜索网址
  • 给网站做cdn代运营一个月多少钱