From 5d48899de7feba918ffb1ee266eaa403b65f96f2 Mon Sep 17 00:00:00 2001 From: Ashish Kurmi Date: Mon, 9 Dec 2024 00:58:56 +0530 Subject: [PATCH] adding harden-runner enabled format workflows --- .../workflows/format-harden-runner-audit.yml | 66 +++++++++++++++++++ .../workflows/format-harden-runner-block.yml | 66 +++++++++++++++++++ .github/workflows/format.yml | 2 +- 3 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/format-harden-runner-audit.yml create mode 100644 .github/workflows/format-harden-runner-block.yml diff --git a/.github/workflows/format-harden-runner-audit.yml b/.github/workflows/format-harden-runner-audit.yml new file mode 100644 index 00000000..d5e1bb8d --- /dev/null +++ b/.github/workflows/format-harden-runner-audit.yml @@ -0,0 +1,66 @@ +# Ultralytics 🚀 - AGPL-3.0 License https://ultralytics.com/license +# Ultralytics Actions https://github.com/ultralytics/actions +# This workflow automatically formats code and documentation in PRs to official Ultralytics standards + +name: Ultralytics Actions Harden-Runner Audit + +on: + issues: + types: [opened, edited] + discussion: + types: [created] + pull_request_target: + branches: [main] + types: [opened, closed, synchronize, review_requested] + +jobs: + format: + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + + - name: Run Ultralytics Formatting + uses: ultralytics/actions@eb1201bd933b9f6096c64525ccaee3684c91bf14 # Pinning to vulnerable Action version + with: + token: ${{ secrets._GITHUB_TOKEN }} # note GITHUB_TOKEN automatically generated + labels: true # autolabel issues and PRs + python: true # format Python code and docstrings + prettier: true # format YAML, JSON, Markdown and CSS + spelling: true # check spelling + links: false # check broken links + summary: true # print PR summary with GPT4o (requires 'openai_api_key') + openai_api_key: ${{ secrets.OPENAI_API_KEY }} + first_issue_response: | + 👋 Hello @${{ github.actor }}, thank you for your interest in Ultralytics 🚀! We recommend a visit to the [Docs](https://docs.ultralytics.com) for new users where you can find many [Python](https://docs.ultralytics.com/usage/python/) and [CLI](https://docs.ultralytics.com/usage/cli/) usage examples and where many of the most common questions may already be answered. + + If this is a 🐛 Bug Report, please provide a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/) to help us debug it. + + If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our [Tips for Best Training Results](https://docs.ultralytics.com/guides/model-training-tips/). + + Join the Ultralytics community where it suits you best. For real-time chat, head to [Discord](https://discord.com/invite/ultralytics) 🎧. Prefer in-depth discussions? Check out [Discourse](https://community.ultralytics.com). Or dive into threads on our [Subreddit](https://reddit.com/r/Ultralytics) to share knowledge with the community. + + ## Upgrade + + Upgrade to the latest `ultralytics` package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/) to verify your issue is not already resolved in the latest version: + + ```bash + pip install -U ultralytics + ``` + + ## Environments + + YOLO may be run in any of the following up-to-date verified environments (with all dependencies including [CUDA](https://developer.nvidia.com/cuda)/[CUDNN](https://developer.nvidia.com/cudnn), [Python](https://www.python.org/) and [PyTorch](https://pytorch.org/) preinstalled): + + - **Notebooks** with free GPU: Run on Gradient Open In Colab Open In Kaggle + - **Google Cloud** Deep Learning VM. See [GCP Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/google_cloud_quickstart_tutorial/) + - **Amazon** Deep Learning AMI. See [AWS Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/aws_quickstart_tutorial/) + - **Docker Image**. See [Docker Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/docker_image_quickstart_tutorial/) Docker Pulls + + ## Status + + Ultralytics CI + + If this badge is green, all [Ultralytics CI](https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml?query=event%3Aschedule) tests are currently passing. CI tests verify correct operation of all YOLO [Modes](https://docs.ultralytics.com/modes/) and [Tasks](https://docs.ultralytics.com/tasks/) on macOS, Windows, and Ubuntu every 24 hours and on every commit. diff --git a/.github/workflows/format-harden-runner-block.yml b/.github/workflows/format-harden-runner-block.yml new file mode 100644 index 00000000..526fd63c --- /dev/null +++ b/.github/workflows/format-harden-runner-block.yml @@ -0,0 +1,66 @@ +# Ultralytics 🚀 - AGPL-3.0 License https://ultralytics.com/license +# Ultralytics Actions https://github.com/ultralytics/actions +# This workflow automatically formats code and documentation in PRs to official Ultralytics standards + +name: Ultralytics Actions Harden-Runner Block + +on: + issues: + types: [opened, edited] + discussion: + types: [created] + pull_request_target: + branches: [main] + types: [opened, closed, synchronize, review_requested] + +jobs: + format: + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + + - name: Run Ultralytics Formatting + uses: ultralytics/actions@eb1201bd933b9f6096c64525ccaee3684c91bf14 # Pinning to vulnerable Action version + with: + token: ${{ secrets._GITHUB_TOKEN }} # note GITHUB_TOKEN automatically generated + labels: true # autolabel issues and PRs + python: true # format Python code and docstrings + prettier: true # format YAML, JSON, Markdown and CSS + spelling: true # check spelling + links: false # check broken links + summary: true # print PR summary with GPT4o (requires 'openai_api_key') + openai_api_key: ${{ secrets.OPENAI_API_KEY }} + first_issue_response: | + 👋 Hello @${{ github.actor }}, thank you for your interest in Ultralytics 🚀! We recommend a visit to the [Docs](https://docs.ultralytics.com) for new users where you can find many [Python](https://docs.ultralytics.com/usage/python/) and [CLI](https://docs.ultralytics.com/usage/cli/) usage examples and where many of the most common questions may already be answered. + + If this is a 🐛 Bug Report, please provide a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/) to help us debug it. + + If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our [Tips for Best Training Results](https://docs.ultralytics.com/guides/model-training-tips/). + + Join the Ultralytics community where it suits you best. For real-time chat, head to [Discord](https://discord.com/invite/ultralytics) 🎧. Prefer in-depth discussions? Check out [Discourse](https://community.ultralytics.com). Or dive into threads on our [Subreddit](https://reddit.com/r/Ultralytics) to share knowledge with the community. + + ## Upgrade + + Upgrade to the latest `ultralytics` package including all [requirements](https://github.com/ultralytics/ultralytics/blob/main/pyproject.toml) in a [**Python>=3.8**](https://www.python.org/) environment with [**PyTorch>=1.8**](https://pytorch.org/get-started/locally/) to verify your issue is not already resolved in the latest version: + + ```bash + pip install -U ultralytics + ``` + + ## Environments + + YOLO may be run in any of the following up-to-date verified environments (with all dependencies including [CUDA](https://developer.nvidia.com/cuda)/[CUDNN](https://developer.nvidia.com/cudnn), [Python](https://www.python.org/) and [PyTorch](https://pytorch.org/) preinstalled): + + - **Notebooks** with free GPU: Run on Gradient Open In Colab Open In Kaggle + - **Google Cloud** Deep Learning VM. See [GCP Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/google_cloud_quickstart_tutorial/) + - **Amazon** Deep Learning AMI. See [AWS Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/aws_quickstart_tutorial/) + - **Docker Image**. See [Docker Quickstart Guide](https://docs.ultralytics.com/yolov5/environments/docker_image_quickstart_tutorial/) Docker Pulls + + ## Status + + Ultralytics CI + + If this badge is green, all [Ultralytics CI](https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml?query=event%3Aschedule) tests are currently passing. CI tests verify correct operation of all YOLO [Modes](https://docs.ultralytics.com/modes/) and [Tasks](https://docs.ultralytics.com/tasks/) on macOS, Windows, and Ubuntu every 24 hours and on every commit. diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 1208a5de..7fc603b4 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Run Ultralytics Formatting - uses: ultralytics/actions@eb1201bd933b9f6096c64525ccaee3684c91bf14 + uses: ultralytics/actions@eb1201bd933b9f6096c64525ccaee3684c91bf14 # Pinning to vulnerable Action version with: token: ${{ secrets._GITHUB_TOKEN }} # note GITHUB_TOKEN automatically generated labels: true # autolabel issues and PRs