From fdcb60a60a086aa91afb56cb0bbc8d30a40c345a Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 7 Nov 2024 15:55:20 +0100 Subject: [PATCH] Add environment to publish.yml (#17395) --- .github/workflows/docs.yml | 2 +- .github/workflows/publish.yml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d476d8283..ea6def886 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -39,7 +39,7 @@ jobs: uses: actions/checkout@v4 with: repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} - token: ${{ secrets._GITHUB_TOKEN }} + token: ${{ secrets._GITHUB_TOKEN || secrets.GITHUB_TOKEN }} ref: ${{ github.head_ref || github.ref }} fetch-depth: 0 - name: Set up Python diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a41a90822..bccc28332 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,13 +17,16 @@ jobs: if: github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher' name: Publish runs-on: ubuntu-latest + environment: # for GitHub Deployments tab + name: Release - PyPI + url: https://pypi.org/p/ultralytics permissions: id-token: write # for PyPI trusted publishing steps: - name: Checkout code uses: actions/checkout@v4 with: - token: ${{ secrets._GITHUB_TOKEN }} # use your PAT here + token: ${{ secrets._GITHUB_TOKEN }} - name: Git config run: | git config --global user.name "UltralyticsAssistant" @@ -32,7 +35,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.x" - cache: "pip" # caching pip dependencies + cache: "pip" - name: Install dependencies run: | python -m pip install --upgrade pip wheel