diff --git a/.github/workflows/doc_review.yml b/.github/workflows/doc_review.yml index b630204bde7c7..0c6ab1dacf959 100644 --- a/.github/workflows/doc_review.yml +++ b/.github/workflows/doc_review.yml @@ -16,11 +16,15 @@ jobs: review: runs-on: ubuntu-latest if: > - github.event_name == 'workflow_dispatch' || + github.repository == 'pingcap/docs' && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.actor) && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.triggering_actor) && ( - github.event_name == 'issue_comment' && - contains(github.event.comment.body, '/bot-review') && - (github.event.comment.user.login == 'lilin90' || github.event.comment.user.login == 'qiancai' || github.event.comment.user.login == 'seominjea1942') + github.event_name == 'workflow_dispatch' || + ( + github.event_name == 'issue_comment' && + contains(github.event.comment.body, '/bot-review') + ) ) steps: - name: Checkout Repo diff --git a/.github/workflows/sync-cloud-zh-toc.yml b/.github/workflows/sync-cloud-zh-toc.yml index d30cd15069bdf..43840c787d8aa 100644 --- a/.github/workflows/sync-cloud-zh-toc.yml +++ b/.github/workflows/sync-cloud-zh-toc.yml @@ -13,7 +13,10 @@ env: jobs: sync-toc: - if: github.repository == 'pingcap/docs' + if: > + github.repository == 'pingcap/docs' && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.actor) && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.triggering_actor) runs-on: ubuntu-latest steps: @@ -25,12 +28,15 @@ jobs: token: ${{ github.token }} - name: Copy script from main branch (temporary) + env: + GH_TOKEN: ${{ github.token }} run: | mkdir -p temp_scripts - curl -H "Authorization: Bearer ${{ github.token }}" \ - -H "Accept: application/vnd.github.v3.raw" \ - -L "https://api.github.com/repos/${{ github.repository }}/contents/scripts/sync-en-cloud-toc-changes-to-zh.py" \ - -o temp_scripts/sync-en-cloud-toc-changes-to-zh.py + gh api \ + --method GET \ + "repos/${{ github.repository }}/contents/scripts/sync-en-cloud-toc-changes-to-zh.py" \ + -H "Accept: application/vnd.github.raw+json" \ + > temp_scripts/sync-en-cloud-toc-changes-to-zh.py - uses: actions/setup-python@v6 name: Setup Python 3.11 diff --git a/.github/workflows/sync-doc-pr-zh-to-en.yml b/.github/workflows/sync-doc-pr-zh-to-en.yml index beb6c8bbb4100..1c5aff1d4c028 100644 --- a/.github/workflows/sync-doc-pr-zh-to-en.yml +++ b/.github/workflows/sync-doc-pr-zh-to-en.yml @@ -24,7 +24,10 @@ env: jobs: sync-docs: runs-on: ubuntu-latest - if: contains(fromJson('["hfxsd","likidu","lilin90","Oreoxmt","qiancai"]'), github.actor) + if: > + github.repository == 'pingcap/docs' && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.actor) && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.triggering_actor) steps: - name: Checkout current repository diff --git a/.github/workflows/translation-cron.yml b/.github/workflows/translation-cron.yml index 4934f7a6ec668..ab31c58b32eb7 100644 --- a/.github/workflows/translation-cron.yml +++ b/.github/workflows/translation-cron.yml @@ -56,7 +56,22 @@ env: jobs: translate-ja: - if: github.repository == 'pingcap/docs' + if: > + github.repository == 'pingcap/docs' && + ( + ( + github.event_name == 'schedule' && + ( + github.run_attempt == 1 || + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.triggering_actor) + ) + ) || + ( + github.event_name == 'workflow_dispatch' && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.actor) && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.triggering_actor) + ) + ) runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/translation-zh.yaml b/.github/workflows/translation-zh.yaml index 1437d63f6027b..ac604ef8d16b5 100644 --- a/.github/workflows/translation-zh.yaml +++ b/.github/workflows/translation-zh.yaml @@ -46,7 +46,22 @@ env: jobs: translate: - if: github.repository == 'pingcap/docs' + if: > + github.repository == 'pingcap/docs' && + ( + ( + github.event_name == 'schedule' && + ( + github.run_attempt == 1 || + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.triggering_actor) + ) + ) || + ( + github.event_name == 'workflow_dispatch' && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.actor) && + contains(fromJson('["lilin90","qiancai","seominjea1942"]'), github.triggering_actor) + ) + ) runs-on: ubuntu-latest permissions: