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
11 changes: 2 additions & 9 deletions .github/workflows/auto-add-ready-for-doc-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,11 @@ jobs:
- name: Check out repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- 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 }}

- name: Check team membership
id: membership_check
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
try {
await github.rest.teams.getMembershipForUserInOrg({
Expand All @@ -55,7 +48,7 @@ jobs:
- name: Add ready-for-doc-review label
if: steps.membership_check.outputs.result == 'false'
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
gh pr edit $PR_URL --add-label ready-for-doc-review
13 changes: 2 additions & 11 deletions .github/workflows/benchmark-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ jobs:
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
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

- name: Build
Expand All @@ -58,7 +49,7 @@ jobs:
- name: Check results and create issue if needed
if: always()
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
echo "Reading benchmark results..."
Expand Down Expand Up @@ -174,4 +165,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ steps.app-token.outputs.token }}
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
31 changes: 11 additions & 20 deletions .github/workflows/changelog-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,11 @@ jobs:
)
runs-on: ubuntu-latest
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-internal,docs-content,docs-engineering

- name: Resolve PR data
id: resolve_pr
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
let pr;
if (context.eventName === 'workflow_dispatch') {
Expand Down Expand Up @@ -86,7 +77,7 @@ jobs:
id: check_team
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const author = '${{ steps.resolve_pr.outputs.pr_author }}';

Expand Down Expand Up @@ -124,7 +115,7 @@ jobs:
env:
PR_BODY: ${{ steps.resolve_pr.outputs.pr_body }}
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const body = process.env.PR_BODY || '';

Expand Down Expand Up @@ -159,7 +150,7 @@ jobs:
id: check_parent
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const issueNumber = parseInt('${{ steps.extract_issue.outputs.issue_number }}', 10);

Expand Down Expand Up @@ -240,7 +231,7 @@ jobs:
PR_BODY: ${{ steps.resolve_pr.outputs.pr_body }}
PR_URL: ${{ steps.resolve_pr.outputs.pr_url }}
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const prNumber = parseInt('${{ steps.resolve_pr.outputs.pr_number }}', 10);
const prAuthor = '${{ steps.resolve_pr.outputs.pr_author }}';
Expand Down Expand Up @@ -281,7 +272,7 @@ jobs:
id: check_existing
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const branchName = `changelog-agent-${{ steps.resolve_pr.outputs.pr_number }}`;
const { data: pulls } = await github.rest.pulls.list({
Expand All @@ -304,7 +295,7 @@ jobs:
id: read_examples
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
// Fetch changelog-internal.md from docs-content
const { data } = await github.rest.repos.getContent({
Expand Down Expand Up @@ -474,7 +465,7 @@ jobs:
PARENT_AUTHOR: ${{ steps.check_parent.outputs.parent_author }}
PARENT_ASSIGNEES: ${{ steps.check_parent.outputs.parent_assignees }}
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const branchName = `changelog-agent-${{ steps.resolve_pr.outputs.pr_number }}`;
const filePath = 'docs-content-docs/docs-content-workflows/changelog-internal.md';
Expand Down Expand Up @@ -635,7 +626,7 @@ jobs:
PARENT_AUTHOR: ${{ steps.check_parent.outputs.parent_author }}
PARENT_ASSIGNEES: ${{ steps.check_parent.outputs.parent_assignees }}
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const author = process.env.PR_AUTHOR;
const changelogPrUrl = process.env.CHANGELOG_PR_URL;
Expand Down Expand Up @@ -730,7 +721,7 @@ jobs:
if: steps.create_pr.outputs.changelog_pr_url != '' && inputs.dry_run != true
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const changelogPrUrl = '${{ steps.create_pr.outputs.changelog_pr_url }}';
await github.rest.issues.createComment({
Expand All @@ -753,4 +744,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ steps.app-token.outputs.token }}
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
11 changes: 2 additions & 9 deletions .github/workflows/changelog-prompt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@ jobs:
runs-on: ubuntu-latest

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 }}

- name: Check if PR author is in docs-content team
id: check_team
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
try {
const pr = context.payload.pull_request;
Expand All @@ -50,7 +43,7 @@ jobs:

uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
// Get PR author username
const pr = context.payload.pull_request;
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/check-for-spammy-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@ jobs:
if: github.repository == 'github/docs'
runs-on: ubuntu-latest
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 }}

- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |

const issue = context.payload.issue
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/close-bad-repo-sync-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,10 @@ jobs:
name: Close if invalid repo-sync PR author
runs-on: ubuntu-latest
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 }}

- name: Close pull request if unwanted
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
const { owner, repo } = context.repo
const prCreator = context.actor
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,7 @@ jobs:
with:
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

- name: Generate GitHub App token
if: ${{ failure() && github.event_name != 'pull_request' }}
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/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'pull_request' }}
with:
token: ${{ steps.app-token.outputs.token }}
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
11 changes: 1 addition & 10 deletions .github/workflows/confirm-internal-staff-work-in-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,12 @@ jobs:
continue-on-error: true
if: github.repository == 'github/docs' && github.actor != 'docs-bot'
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: ${{ secrets.TEAM_CONTENT_REPO }}

- id: membership_check
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
env:
TEAM_CONTENT_REPO: ${{ secrets.TEAM_CONTENT_REPO }}
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
// Only perform this action with GitHub employees
try {
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/content-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ jobs:

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

- 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,copilot-cli-generated-docs,docs-engineering

- name: Install Copilot CLI
run: npm install -g @github/copilot@prerelease

Expand Down Expand Up @@ -101,7 +92,7 @@ jobs:

- name: Run content pipeline update script
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COPILOT_GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_COPILOT }}
run: npx tsx src/content-pipelines/scripts/update.ts --id "${{ matrix.id }}"
Expand Down Expand Up @@ -149,7 +140,7 @@ jobs:
- name: Create or update PR
if: steps.commit.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
UPDATE_BRANCH: ${{ steps.branch.outputs.update_branch }}
PIPELINE_ID: ${{ matrix.id }}
SOURCE_REPO: ${{ steps.source-info.outputs.source_repo }}
Expand Down Expand Up @@ -204,4 +195,4 @@ jobs:
- uses: ./.github/actions/create-workflow-failure-issue
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
with:
token: ${{ steps.app-token.outputs.token }}
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
13 changes: 2 additions & 11 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,18 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- 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: ${{ steps.app-token.outputs.token }}
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

# 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: ${{ steps.app-token.outputs.token }}
token: ${{ secrets.DOCS_BOT_PAT_BASE }}

# Many test suites depend on Next.js build artifacts.
- name: Build
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/copy-api-issue-to-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,11 @@ jobs:
runs-on: ubuntu-latest
if: github.event.label.name == 'fix-internally' && github.repository == 'github/docs'
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,docs-content

- name: Check if this run was triggered by a member of the docs team
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
id: triggered-by-member
with:
github-token: ${{ steps.app-token.outputs.token }}
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
result-encoding: string
script: |
const triggerer_login = context.payload.sender.login
Expand Down Expand Up @@ -59,26 +50,26 @@ jobs:
Copied to this repo by the [$GITHUB_WORKFLOW workflow run]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)." --repo github/docs-content --label "workflow-generated")"
echo 'NEW_ISSUE='$new_issue_url >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}

- name: Comment on the old issue
run: gh issue comment $OLD_ISSUE --body "Thank you for opening this issue! Updates to this documentation must be made internally. I have copied your issue to an internal issue, so I will close this issue."
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
OLD_ISSUE: ${{ github.event.issue.html_url }}

- name: Close the old issue
run: gh issue close $OLD_ISSUE
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
OLD_ISSUE: ${{ github.event.issue.html_url }}

- name: Comment on the new issue
run: gh issue comment $NEW_ISSUE --body "This issue was originally opened in the open source repo as $OLD_ISSUE"
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
NEW_ISSUE: ${{ env.NEW_ISSUE }}
OLD_ISSUE: ${{ github.event.issue.html_url }}

Expand Down
Loading
Loading