From 98852d945da1baa2b5615018e268768b4a4f96a7 Mon Sep 17 00:00:00 2001 From: Ido Heyvi Date: Wed, 8 Jan 2025 12:15:50 +0200 Subject: [PATCH] chore: Reverting since docs CI is broken. We should have a fix for this laer on Signed-off-by: Ido Heyvi --- .github/workflows/docs-ci.yaml | 42 +++++++++------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/.github/workflows/docs-ci.yaml b/.github/workflows/docs-ci.yaml index 4eda7d9..0234401 100644 --- a/.github/workflows/docs-ci.yaml +++ b/.github/workflows/docs-ci.yaml @@ -6,52 +6,32 @@ on: git_tag: type: string description: The git tag (version) from the calling workflow - gh_docs_token: - type: string - description: Assigned nvidia-ci-cd PAT with docs repo r/w pull request permissions - + required: true workflow_dispatch: inputs: git_tag: type: string description: The git tag (version) to use for `$TAG` + required: true jobs: docs-ci: runs-on: ubuntu-latest env: - GH_TOKEN: ${{ inputs.gh_docs_token }} - # keeping TAG for cases docs repo workflow is triggered with tag input + GH_TOKEN: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }} TAG: ${{ inputs.git_tag }} - REF_NAME: ${{ github.ref_name }} - # in case of pushed PR, ref_head specifies PR's branch - REF_HEAD: ${{ github.head_ref }} - # will be used to specify repo tar url according to PR id - PR_NUMBER: ${{ github.event.number }} PR_TITLE_PREFIX: "task: update documentation for" steps: - uses: actions/checkout@v4 with: repository: ${{ github.repository_owner }}/network-operator-docs # repo must be explicitly set here for workflow calling to behave correctly - token: ${{ inputs.token || inputs.gh_docs_token }} + token: ${{ inputs.token || secrets.GH_TOKEN_NVIDIA_CI_CD }} # token must be explicitly set here for push to work in following step - name: Setup Go uses: actions/setup-go@v5.0.2 with: go-version: 1.23.x - name: Make docs - # handle triggered workflow by pushed tag or PR run: | - if [[ -n $PR_NUMBER ]]; then - export BRANCH=$REF_HEAD - echo "REF_NAME=$REF_HEAD" >> $GITHUB_ENV - echo "COMMIT_SUFFIX=pull/$PR_NUMBER" >> $GITHUB_ENV - else - TAG="${TAG:-$REF_NAME}" - export TAG - echo "TAG=$TAG" >> $GITHUB_ENV - echo "COMMIT_SUFFIX=$TAG" >> $GITHUB_ENV - fi - make api-docs helm-docs generate-docs-versions-var - name: Close any existing documentation PRs run: | @@ -60,23 +40,23 @@ jobs: done - name: Create PR env: - REF_NAME: ${{ github.ref_name }} DOWNSTREAM_REPO_OWNER: nvidia-ci-cd - DOWNSTREAM_FEATURE_BRANCH: update-docs-for-${{ env.REF_NAME }} + DOWNSTREAM_FEATURE_BRANCH: update-docs-for-${{ env.TAG }} UPSTREAM_REPO_OWNER: Mellanox UPSTREAM_DEFAULT_BRANCH: main + COMMIT_MESSAGE: ${{ env.PR_TITLE_PREFIX }} ${{ env.TAG }} run: | - git config user.name nvidia-ci-cd + git config user.name nvidia-ci-cd git config user.email svc-cloud-orch-gh@nvidia.com - export GH_TOKEN=${{ env.GH_TOKEN }} + gh repo fork --remote --default-branch-only + gh repo sync $DOWNSTREAM_REPO_OWNER/${{ github.event.repository.name }} --source $UPSTREAM_REPO_OWNER/${{ github.event.repository.name }} --branch $UPSTREAM_DEFAULT_BRANCH - gh repo sync $DOWNSTREAM_REPO_OWNER/network-operator-docs --source $UPSTREAM_REPO_OWNER/network-operator-docs --branch $UPSTREAM_DEFAULT_BRANCH git checkout -b $DOWNSTREAM_FEATURE_BRANCH + git status git add docs - COMMIT_MESSAGE="$PR_TITLE_PREFIX $COMMIT_SUFFIX" git commit -m "$COMMIT_MESSAGE" - git push -u origin $DOWNSTREAM_FEATURE_BRANCH --force + git push -u origin $DOWNSTREAM_FEATURE_BRANCH gh pr create \ --head $DOWNSTREAM_REPO_OWNER:$DOWNSTREAM_FEATURE_BRANCH \ --base $UPSTREAM_DEFAULT_BRANCH \