Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/benchmark-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ jobs:
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: 'false'
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-engineering

- uses: ./.github/actions/node-npm-setup

Expand All @@ -50,7 +58,7 @@ jobs:
- name: Check results and create issue if needed
if: always()
env:
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
echo "Reading benchmark results..."
Expand Down Expand Up @@ -166,4 +174,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
11 changes: 10 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-engineering

- uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7
with:
languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp, ruby}
Expand All @@ -44,4 +53,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'pull_request' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
12 changes: 10 additions & 2 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,27 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-early-access

- uses: ./.github/actions/node-npm-setup

# Search and language test suites require a running Elasticsearch instance.
- uses: ./.github/actions/setup-elasticsearch
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}

# docs-internal has early-access content that must be fetched separately.
- uses: ./.github/actions/get-docs-early-access
if: ${{ github.repository == 'github/docs-internal' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}

# Many test suites depend on Next.js build artifacts.
- name: Build
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/delete-orphan-translation-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,20 @@ jobs:

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-internal.es-es,docs-internal.ja-jp,docs-internal.pt-br,docs-internal.zh-cn,docs-internal.ru-ru,docs-internal.fr-fr,docs-internal.ko-kr,docs-internal.de-de,docs-engineering

- name: Checkout the language-specific repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: ${{ matrix.language_repo }}
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
path: ${{ matrix.language_dir }}

- uses: ./.github/actions/node-npm-setup
Expand All @@ -89,7 +97,7 @@ jobs:
working-directory: ${{ matrix.language_dir }}
env:
# Needed for gh
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
# If nothing to commit, exit now. It's fine. No orphans.
changes=$(git diff --name-only | wc -l)
Expand Down Expand Up @@ -164,4 +172,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
16 changes: 12 additions & 4 deletions .github/workflows/enterprise-dates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,21 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-internal,docs-engineering

- uses: ./.github/actions/node-npm-setup

- name: Run src/ghes-releases/scripts/update-enterprise-dates.ts
run: npm run update-enterprise-dates
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Create pull request
id: create-pull-request
Expand All @@ -41,7 +49,7 @@ jobs:
HUSKY: '0'
with:
# need to use a token with repo and workflow scopes for this step
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
commit-message: '🤖 ran src/ghes-releases/scripts/update-enterprise-dates.ts'
title: 🤖 src/ghes-releases/lib/enterprise-dates.json update
body:
Expand All @@ -54,7 +62,7 @@ jobs:
- name: Enable GitHub auto-merge
if: ${{ steps.create-pull-request.outputs.pull-request-number }}
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
AUTOMERGE_PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
run: npm run enable-automerge

Expand All @@ -77,4 +85,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
14 changes: 11 additions & 3 deletions .github/workflows/enterprise-release-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,26 @@ jobs:
steps:
- name: Checkout repository code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-content,docs-engineering

- uses: ./.github/actions/node-npm-setup

- name: Create an enterprise release issue
run: npm run create-enterprise-issue -- release
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- name: Create an enterprise deprecation issue
run: npm run create-enterprise-issue -- deprecation
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- uses: ./.github/actions/slack-alert
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
Expand All @@ -41,4 +49,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
37 changes: 31 additions & 6 deletions .github/workflows/index-general-search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ jobs:
outputs:
matrix: ${{ steps.set-matrix.outputs.result }}
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-engineering

- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
id: set-matrix
with:
Expand Down Expand Up @@ -102,7 +111,7 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}

updateElasticsearchIndexes:
needs: figureOutMatrix
Expand All @@ -126,20 +135,28 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-internal-data,docs-internal.es-es,docs-internal.ja-jp,docs-internal.pt-br,docs-internal.zh-cn,docs-internal.ru-ru,docs-internal.fr-fr,docs-internal.ko-kr,docs-internal.de-de,docs-engineering

- name: Clone docs-internal-data
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: github/docs-internal-data
# This works because user `docs-bot` has read access to that private repo.
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
path: docs-internal-data

- name: Clone all translations
if: ${{ matrix.language != 'en' }}
uses: ./.github/actions/clone-translations
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}

- uses: ./.github/actions/node-npm-setup

Expand Down Expand Up @@ -249,7 +266,7 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}

notifyScrapingFailures:
name: Notify scraping failures
Expand All @@ -259,6 +276,14 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-engineering

- name: Download all failure artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
Expand Down Expand Up @@ -294,7 +319,7 @@ jobs:
- name: Comment on or create scraping failure issue
if: ${{ steps.check-artifacts.outputs.has_artifacts == 'true' && fromJSON(steps.aggregate.outputs.result || '{"hasFailures":false}').hasFailures }}
env:
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}
FAILURE_MESSAGE: ${{ fromJSON(steps.aggregate.outputs.result || '{"message":""}').message }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
FILE_URL: ${{ github.server_url }}/${{ github.repository }}/blob/main/.github/workflows/index-general-search.yml
Expand Down Expand Up @@ -393,4 +418,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
10 changes: 9 additions & 1 deletion .github/workflows/keep-caches-warm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-engineering

- uses: ./.github/actions/node-npm-setup

Expand All @@ -52,4 +60,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
12 changes: 10 additions & 2 deletions .github/workflows/link-check-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-content,docs-engineering

- uses: ./.github/actions/node-npm-setup

Expand Down Expand Up @@ -71,7 +79,7 @@ jobs:
if: always() && steps.check_report.outputs.has_report == 'true'
uses: peter-evans/create-issue-from-file@65115121ba9a3573cbaded4dc66b90ba1f9b69dc
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
repository: github/docs-content
title: '🌐 Broken External Links Report'
content-filepath: artifacts/external-link-report.md
Expand All @@ -85,4 +93,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
16 changes: 11 additions & 5 deletions .github/workflows/link-check-github-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest
env:
# need to use a token from a user with access to github/github for this step
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
REPORT_AUTHOR: docs-bot
REPORT_LABEL: github github broken link report,workflow-generated
REPORT_REPOSITORY: github/docs-content
Expand All @@ -28,12 +26,20 @@ jobs:
with:
# To prevent issues with cloning early access content later
persist-credentials: 'false'
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.DOCS_BOT_APP_ID }}
private-key: ${{ secrets.DOCS_BOT_APP_PRIVATE_KEY }}
owner: github
repositories: docs-content,docs-early-access,github,docs-engineering

- uses: ./.github/actions/node-npm-setup

- uses: ./.github/actions/get-docs-early-access
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}

- name: Build server
run: npm run build
Expand Down Expand Up @@ -65,7 +71,7 @@ jobs:
id: github-github-broken-link-report
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710
with:
token: ${{ env.GITHUB_TOKEN }}
token: ${{ steps.app-token.outputs.token }}
title: ${{ steps.check.outputs.title }}
content-filepath: ./broken_github_github_links.md
repository: ${{ env.REPORT_REPOSITORY }}
Expand All @@ -79,4 +85,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
token: ${{ steps.app-token.outputs.token }}
Loading
Loading