如何在GitHub中为新用户设置操作? [英] How to set up actions in GitHub for new user?

查看:76
本文介绍了如何在GitHub中为新用户设置操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚获得一个GitHub帐户,并用我正在学习的Python编写了小的脚本.

I just got a GitHub account and writing small scripts in Python which I am learning.

将代码添加到GitHub时,我注意到可以对代码运行测试/验证,但我的代码为空.

While adding my code to GitHub I noticed there is an option to run tests/validation on my code but mine is empty.

我在Google周围搜索,发现皮棉和黑色是不错的支票.

I googled around and found that lint and black and are good checks.

我找到了要添加的操作- https://github.com/marketplace/actions/python-quality-and-format-checker

I found this Action that I want to add - https://github.com/marketplace/actions/python-quality-and-format-checker

我认为我需要在某个地方添加/更新脚本"和配置".另外,当我单击使用最新版本"时,它告诉我将代码添加到某些.yml中.

There is a "script" and a "config" that I think I need to add/update somewhere. Also when I click "Use latest version" it tells me to add the code into some .yml.

任何人都可以协助我安装此Action或为我指明正确的方向吗?另外,如何在所有存储库/代码上使用此操作?

Can anyone assist me in installing this Action or point me in the right direction? Also, how can I use this Action on all my repositories/code?

======================================

=======================================

此链接具有说明- https://help.github.com/zh-CN/actions/configuring-and-managing-workflows/configuring-a-workflow

在此目录中放置yaml或yml-> .github/workflows

place yaml or yml in this directory -> .github/workflows

为此操作: https://github.com/marketplace/actions/python-quality-and-format-checker

文件中的代码如下所示:

the code inside the file will look like this:

on: [push, pull_request]
name: Python Linting
jobs:
  PythonLinting:
    name: Python linting
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Konstruktoid Python linting
        uses: konstruktoid/action-pylint@master

感谢:贝尔特朗·马特尔

推荐答案

圆筒 是新的 github/super-linter ):

GitHub Super Linter简介:一羽linter可以将它们全部统治

Super Linter是一个源代码存储库,打包到Docker容器中,并由GitHub Actions调用.这允许GitHub.com上的任何存储库调用Super Linter并开始利用其优势.

The Super Linter is a source code repository that is packaged into a Docker container and called by GitHub Actions. This allows for any repository on GitHub.com to call the Super Linter and start utilizing its benefits.

将存储库设置为开始运行此操作后,无论何时打开拉取请求,存储库都会开始整理代码并通过Status API返回.
它会通知您是否成功通过了任何代码更改,或者是否检测到任何错误,它们在哪里以及它们是什么.

When you’ve set your repository to start running this action, any time you open a pull request, it will start linting the code case and return via the Status API.
It will let you know if any of your code changes passed successfully, or if any errors were detected, where they are, and what they are.

然后,这使开发人员可以返回其分支机构,解决所有问题,并为打开请求请求创建新的推送.
届时,Super Linter将再次运行并验证更新的代码并重复该过程.

This then allows the developer to go back to their branch, fix any issues, and create a new push to the open pull request.
At that point, the Super Linter will run again and validate the updated code and repeat the process.

您可以将其设置为仅int新文件如果需要的话.

更新2020年8月:

github/super-linter 问题226 已通过 PR 593 关闭:

此PR将添加:

  • 黑色蟒蛇皮衬里
  • 更新的测试

这篇关于如何在GitHub中为新用户设置操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆