diff --git a/.github/workflows/sync-staging-repo-files.yml b/.github/workflows/sync-staging-repo-files.yml deleted file mode 100644 index 736d8cf07b3c..000000000000 --- a/.github/workflows/sync-staging-repo-files.yml +++ /dev/null @@ -1,194 +0,0 @@ -# **What it does**: Synchronizes each of the github/docs-staging-X repositories with the latest build scripts, workflows, and other files from src/deployments/staging. -# **Why we have it**: We want to centralize build config in src/deployments/staging for use across multiple repos. -# **Who does it impact**: Docs engineering, and potentially content writers. - -name: Sync Staging Repo Files - -on: - workflow_dispatch: - push: - branches: [main] - paths: - - 'src/deployments/staging/build-scripts/*.sh' - - 'src/deployments/staging/.github/**' - - 'src/deployments/staging/Dockerfile' - - 'src/deployments/staging/.env.example' - - 'src/deployments/staging/README.staging.md' - - 'src/deployments/staging/ownership.yaml' - - 'src/deployments/staging/config/**' - -permissions: - contents: write - -jobs: - # Determine how many staging repos we have and generate a matrix with repo and index - generate-matrix: - if: github.repository == 'github/docs-internal' - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Checkout source repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 1 # Only need latest commit for config.json - - - name: Read configuration - id: read-config - run: | - sudo apt-get update && sudo apt-get install -y jq - NUMBER_OF_REPOS=$(jq '.number_of_staging_repos' src/deployments/staging/config.json) - if ! [[ "$NUMBER_OF_REPOS" =~ ^[0-9]+$ ]]; then - echo "Invalid number_of_staging_repos in config.json: $NUMBER_OF_REPOS" - exit 1 - fi - echo "number_of_repos=$NUMBER_OF_REPOS" >> $GITHUB_OUTPUT - - - name: Generate repository list with indices - id: generate-repos - run: | - NUMBER_OF_REPOS=${{ steps.read-config.outputs.number_of_repos }} - # Since we use 0-based index e.g. docs-staging-0, we need to subtract 1 - END=$((NUMBER_OF_REPOS - 1)) - repos=() - for i in $(seq 0 $END); do - repos+=("{\"repo\": \"github/docs-staging-$i\", \"index\": $i}") - done - json_repos=$(printf '%s\n' "${repos[@]}" | jq -s -c .) - echo "repos=$json_repos" >> $GITHUB_OUTPUT - - - name: Set matrix - id: set-matrix - run: | - echo "matrix={\"include\": $REPOS}" >> $GITHUB_OUTPUT - env: - REPOS: ${{ steps.generate-repos.outputs.repos }} - - - uses: ./.github/actions/slack-alert - if: ${{ failure() && github.event_name != 'workflow_dispatch' }} - with: - slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} - slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} - - sync: - if: github.repository == 'github/docs-internal' - needs: generate-matrix - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} - steps: - - name: Checkout source repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - # Only need latest commits to sync with - fetch-depth: 2 - - - name: Checkout target repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - repository: ${{ matrix.repo }} - token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }} - path: target_repo - fetch-depth: 2 - - - name: Synchronize files to target repo - env: - INDEX: ${{ matrix.index }} - run: | - # Create necessary directories if they DNE - mkdir -p target_repo/build-scripts - mkdir -p target_repo/.github/workflows - mkdir -p target_repo/config - - # Copy build scripts - cp src/deployments/staging/build-scripts/*.sh target_repo/build-scripts/ || true - - # Copy .github directory - cp -r src/deployments/staging/.github target_repo/ - - # Copy config files - cp -r src/deployments/staging/config/* target_repo/config/ || true - - # Overwrite Dockerfile - cp src/deployments/staging/Dockerfile target_repo/Dockerfile - - # Conditional copy for .env if not present - if [ ! -f target_repo/.env ]; then - cp src/deployments/staging/.env.example target_repo/.env - fi - - # Only copy README.md for non-review servers e.g. index >= 2 - if [ "$INDEX" -ge 2 ]; then - cp src/deployments/staging/README.staging.md target_repo/README.md - fi - - # Copy ownership.yaml - cp src/deployments/staging/ownership.yaml target_repo/ownership.yaml - - - name: Install jq - run: sudo apt-get update && sudo apt-get install -y jq - - - name: Replace template variables - run: | - # Determine which values to use based on the index - INDEX=${{ matrix.index }} - - if [ "$INDEX" -eq 0 ]; then - DOMAIN=$(jq -r '.server_domain_name.internal' src/deployments/staging/config.json) - LOADBALANCER=$(jq -r '.load_balancer_type.internal' src/deployments/staging/config.json) - elif [ "$INDEX" -eq 1 ]; then - DOMAIN=$(jq -r '.server_domain_name.external' src/deployments/staging/config.json) - LOADBALANCER=$(jq -r '.load_balancer_type.external' src/deployments/staging/config.json) - else - DOMAIN=$(jq -r '.server_domain_name["docs-staging-x"]' src/deployments/staging/config.json) - LOADBALANCER=$(jq -r '.load_balancer_type.["docs-staging-x"]' src/deployments/staging/config.json) - - # Replace {{x}} in the domain variable with the current index - DOMAIN=$(echo "$DOMAIN" | sed "s/{{x}}/$INDEX/g") - fi - - # Perform replacements in target_repo files - # Replace the server_domain_name and load_balancer_type - find target_repo -type f -exec sed -i "s|{{server_domain_name}}|$DOMAIN|g" {} + - find target_repo -type f -exec sed -i "s|{{load_balancer_type}}|$LOADBALANCER|g" {} + - - # If any files still contain {{x}}, replace them with the current index - find target_repo -type f -exec sed -i "s/{{x}}/$INDEX/g" {} + - - - name: Commit Changes to new branch - id: commit_changes - run: | - BRANCH_NAME=sync-staging-files-${{ github.run_id }} - cd target_repo - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git checkout -b $BRANCH_NAME - git add . - if ! git diff --cached --quiet; then - git commit -m "Synchronize files from source repository with docs-staging-${{ matrix.index }}" - git push origin $BRANCH_NAME - fi - echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT - - # We want to create a PR instead of committing directly in order to trigger a deployment - - name: Create Pull Request - id: create_pr - env: - GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_READPUBLICKEY }} - run: | - cd target_repo - PR_URL=$(gh pr create \ - --title "Sync files from docs-internal" \ - --body "This PR synchronized the files of this repo with the source of truth files in doc-internal. The PR should automatically merge, if it doesn't please fix files in docs-internal so that the fix is applied to every docs-staging-x repo." \ - --base main \ - --head ${{ steps.commit_changes.outputs.BRANCH_NAME }} \ - ) - # Enable auto-merge on PR - gh pr merge $PR_URL --auto --squash - - - uses: ./.github/actions/slack-alert - if: ${{ failure() && github.event_name != 'workflow_dispatch' }} - with: - slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} - slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} diff --git a/.github/workflows/update-docs-staging-x-repo.yml b/.github/workflows/update-docs-staging-x-repo.yml deleted file mode 100644 index 352560d94e2d..000000000000 --- a/.github/workflows/update-docs-staging-x-repo.yml +++ /dev/null @@ -1,126 +0,0 @@ -# **What it does**: Triggers a repo disaptch event when pushing to a `docs-staging-x` branch -# or when a PR is labeled with `docs-staging-x`. The repo dispatch updates the corresponding -# docs-staging-x repo with the latest commit SHA, which triggers a deployment. -# -# Note: This does not work for docs-staging-{0/1} (review servers) updates to those are -# handled in the `update-review-servers-on-code-push.yml` workflow. -# -# **Why we have it**: Makes staging deployments easy -# **Who does it impact**: Anyone trying to deploy a staging branch, both Docs Content and Docs Engineering - -name: Update docs-staging-x - -on: - push: - branches: - - 'docs-staging-[0-9]*' - pull_request: - types: [labeled] - -permissions: - contents: write - -jobs: - dispatch-sha: - if: github.repository == 'github/docs-internal' - runs-on: ubuntu-latest - - steps: - # Needed because we call a composite action (Slack alert) - - name: Checkout source repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 1 # Only need latest commit - - - name: Determine target staging repo - id: determine_repo - run: | - # Determine the event type - EVENT_TYPE="${{ github.event_name }}" - - SHOULD_DISPATCH="false" - if [ "$EVENT_TYPE" = "push" ]; then - # Triggered by a push event - BRANCH_NAME=${GITHUB_REF#refs/heads/} - echo "Triggered by push event on branch: $BRANCH_NAME" - - # Extract the staging number from branch name - if [[ "$BRANCH_NAME" =~ ^docs-staging-([0-9]+)$ ]]; then - STAGING_NUMBER="${BASH_REMATCH[1]}" - else - echo "Branch name does not match the required pattern docs-staging-X." - exit 1 - fi - - # Get the commit SHA from the push event - COMMIT_SHA="${GITHUB_SHA}" - - elif [ "$EVENT_TYPE" = "pull_request" ]; then - # Triggered by a PR labeled event - LABEL_NAME="${{ github.event.label.name }}" - echo "Triggered by PR labeled event with label: $LABEL_NAME" - - if [[ "$LABEL_NAME" =~ ^docs-staging-([0-9]+)$ ]]; then - STAGING_NUMBER="${BASH_REMATCH[1]}" - else - echo "Label does not match the required pattern docs-staging-X." - # Do not dispatch if it doesn't match - echo "should_dispatch=false" >> $GITHUB_OUTPUT - exit 0 - fi - - # Get the commit SHA from the pull request head - COMMIT_SHA="${{ github.event.pull_request.head.sha }}" - - # Update the docs-staging-x branch to the latest SHA from the PR branch - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git checkout docs-staging-$STAGING_NUMBER || { echo "Failed to checkout docs-staging-$STAGING_NUMBER"; exit 1; } - git reset --hard $COMMIT_SHA || { echo "Git reset failed"; exit 1; } - git push origin docs-staging-$STAGING_NUMBER --force || { echo "Git push failed"; exit 1; } - - else - echo "Event type $EVENT_TYPE not supported." - echo "should_dispatch=false" >> $GITHUB_OUTPUT - exit 0 - fi - - echo "Staging Number: $STAGING_NUMBER" - - # Check if staging number is 0 or 1 - if [ "$STAGING_NUMBER" = "0" ] || [ "$STAGING_NUMBER" = "1" ]; then - echo "Staging number $STAGING_NUMBER is reserved." - echo "Review server repos are handled in the \`update-review-servers-on-code-push.yml\` repository." - echo "should_dispatch=false" >> $GITHUB_OUTPUT - exit 0 - fi - - TARGET_REPO="docs-staging-$STAGING_NUMBER" - echo "Target Repository: $TARGET_REPO" - SHOULD_DISPATCH="true" - - # Set outputs - echo "target_repo=$TARGET_REPO" >> $GITHUB_OUTPUT - echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT - echo "should_dispatch=$SHOULD_DISPATCH" >> $GITHUB_OUTPUT - - - name: Dispatch repository dispatch event to staging repo - if: steps.determine_repo.outputs.should_dispatch == 'true' - env: - REPO_DISPATCH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }} - TARGET_OWNER: github - TARGET_REPO: ${{ steps.determine_repo.outputs.target_repo }} - EVENT_TYPE: update-sha - SHA: ${{ steps.determine_repo.outputs.commit_sha }} - run: | - curl -X POST \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $REPO_DISPATCH_TOKEN" \ - https://api.github.com/repos/$TARGET_OWNER/$TARGET_REPO/dispatches \ - -d "{\"event_type\":\"$EVENT_TYPE\",\"client_payload\":{\"SHA\":\"$SHA\"}}" - - - uses: ./.github/actions/slack-alert - if: ${{ failure() && github.event_name != 'workflow_dispatch' }} - with: - slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} - slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} diff --git a/.github/workflows/update-review-servers-on-code-push.yml b/.github/workflows/update-review-servers-on-code-push.yml deleted file mode 100644 index ff2032eddc1b..000000000000 --- a/.github/workflows/update-review-servers-on-code-push.yml +++ /dev/null @@ -1,67 +0,0 @@ -# **What it does**: Triggers a repo dispatch event when pushing a code change to `main` -# dispatches the latest SHA to both review server repos, `docs-staging-0` and `docs-staging-1` -# -# Note: We only dispatch on code changes to prevent unnecessary deployments since content changes -# won't affect the review servers. -# -# **Why we have it**: Keeps the review servers up-to-date with the latest code changes -# **Who does it impact**: Docs Content and Docs Engineering - -name: Update review servers on code push - -on: - push: - branches: - - main - paths: - - 'src/**' - - 'package.json' - - 'tsconfig.json' - - 'next.config.js' - -permissions: - contents: read - -jobs: - dispatch-sha: - if: github.repository == 'github/docs-internal' - runs-on: ubuntu-latest - strategy: - matrix: - target_repo: [docs-staging-0, docs-staging-1] - - steps: - # Needed because we call a composite action (Slack alert) - - name: Checkout source repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - with: - fetch-depth: 1 # Only need latest commit - - - name: Determine commit SHA and dispatch condition - id: determine_repo - run: | - echo "commit_sha=${GITHUB_SHA}" >> $GITHUB_OUTPUT - # Since this workflow only runs when code changes occur (due to path filters), - # we can always set should_dispatch to true. - echo "should_dispatch=true" >> $GITHUB_OUTPUT - - - name: Dispatch repository dispatch event to staging repos - if: steps.determine_repo.outputs.should_dispatch == 'true' - env: - REPO_DISPATCH_TOKEN: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }} - TARGET_OWNER: github - TARGET_REPO: ${{ matrix.target_repo }} - EVENT_TYPE: update-sha - SHA: ${{ steps.determine_repo.outputs.commit_sha }} - run: | - curl -X POST \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token $REPO_DISPATCH_TOKEN" \ - https://api.github.com/repos/$TARGET_OWNER/$TARGET_REPO/dispatches \ - -d "{\"event_type\":\"$EVENT_TYPE\",\"client_payload\":{\"SHA\":\"$SHA\"}}" - - - uses: ./.github/actions/slack-alert - if: ${{ failure() && github.event_name != 'workflow_dispatch' }} - with: - slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }} - slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }} diff --git a/content/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/about-github-copilot-free.md b/content/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/about-github-copilot-free.md index 8a06ad545b0f..486f463db04b 100644 --- a/content/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/about-github-copilot-free.md +++ b/content/copilot/managing-copilot/managing-copilot-as-an-individual-subscriber/about-github-copilot-free.md @@ -52,15 +52,16 @@ When you reach these limits, you can upgrade to {% data variables.product.prodna There are a few ways to access {% data variables.product.prodname_copilot_free_short %}. -* [{% data variables.product.prodname_vscode_shortname %}](#vs-code) +* [{% data variables.product.prodname_vs %} and {% data variables.product.prodname_vscode_shortname %}](#visual-studio-and-vs-code) * [{% data variables.product.prodname_dotcom_the_website %}](#githubcom) * [Other IDEs](#other-ides) -### {% data variables.product.prodname_vscode_shortname %} +### {% data variables.product.prodname_vs %} and {% data variables.product.prodname_vscode_shortname %} -In {% data variables.product.prodname_vscode_shortname %} you can access {% data variables.product.prodname_copilot_free_short %} directly from the editor. +In {% data variables.product.prodname_vs %} and {% data variables.product.prodname_vscode_shortname %} you can access {% data variables.product.prodname_copilot_free_short %} directly from the editor. -1. In {% data variables.product.prodname_vscode_shortname %}, click **Sign up for {% data variables.product.prodname_copilot_free_short %}** in the sidebar. +1. In the top right of {% data variables.product.prodname_vs %} or {% data variables.product.prodname_vscode_shortname %}, click **{% octicon "copilot" aria-hidden="true" %}**. +1. In the sidebar, click **Sign up for {% data variables.product.prodname_copilot_free_short %}**. 1. If you have a {% data variables.product.github %} account, you will be prompted to sign in. If you don't have a {% data variables.product.github %} account, you will be prompted to create one. ### {% data variables.product.prodname_dotcom_the_website %} @@ -80,6 +81,6 @@ To use {% data variables.product.prodname_copilot_free_short %} in other IDEs, y ## How can I upgrade to {% data variables.product.prodname_copilot_pro_short %}? -If you use {% data variables.product.prodname_copilot_free_short %} in {% data variables.product.prodname_vscode_shortname %} or on {% data variables.product.prodname_dotcom_the_website %} and reach the usage limits, you'll receive a notification. The notification includes the reset date for your limits and a link to set up a 30-day free trial of {% data variables.product.prodname_copilot_pro_short %}. After the trial ends, you'll need a paid subscription to keep using {% data variables.product.prodname_copilot_short %}. +If you use {% data variables.product.prodname_copilot_free_short %} in {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %}, or on {% data variables.product.prodname_dotcom_the_website %}, and reach the usage limits, you'll receive a notification. The notification includes the reset date for your limits and a link to set up a 30-day free trial of {% data variables.product.prodname_copilot_pro_short %}. After the trial ends, you'll need a paid subscription to keep using {% data variables.product.prodname_copilot_short %}. If you use {% data variables.product.prodname_copilot_free_short %} in a different IDE and reach the limits, an error message will appear in your editor. To continue, you can start a 30-day free trial of {% data variables.product.prodname_copilot_pro_short %} in your {% data variables.product.github %} account settings. See [AUTOTITLE](/copilot/setting-up-github-copilot/setting-up-github-copilot-for-yourself#1-get-access-to-github-copilot).