Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from github:main #605

Merged
merged 8 commits into from
Jan 15, 2025
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
59 changes: 44 additions & 15 deletions .github/workflows/sync-staging-repo-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ on:
- 'src/deployments/staging/.github/**'
- 'src/deployments/staging/Dockerfile'
- 'src/deployments/staging/.env.example'
- 'src/deployments/staging/README.example.md'
- 'src/deployments/staging/README.staging.md'
- 'src/deployments/staging/ownership.yaml'
- 'src/deployments/staging/config/**'

permissions:
Expand Down Expand Up @@ -47,18 +48,21 @@ jobs:
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 $NUMBER_OF_REPOS); do
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 output with repo and index
- name: Set matrix
id: set-matrix
run: |
repos=${{ steps.generate-repos.outputs.repos }}
echo "matrix={\"include\": $repos}" >> $GITHUB_OUTPUT
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' }}
Expand All @@ -77,17 +81,20 @@ jobs:
- name: Checkout source repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
# 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_READPUBLICKEY }}
token: ${{ secrets.DOCS_BOT_PAT_WORKFLOW }}
path: target_repo
fetch-depth: 0
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
Expand All @@ -111,11 +118,14 @@ jobs:
cp src/deployments/staging/.env.example target_repo/.env
fi

# Conditional copy for README.md if not present
if [ ! -f target_repo/README.md ]; then
cp src/deployments/staging/README.example.md target_repo/README.md
# 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

Expand Down Expand Up @@ -146,17 +156,36 @@ jobs:
# 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 and push changes
- 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 there are changes, commit and push
if ! git diff --cached --quiet; then
git commit -m "Synchronize files from source repository with index ${{ matrix.index }}"
git push
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' }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/update-docs-staging-x-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
types: [labeled]

permissions:
contents: read
contents: write

jobs:
dispatch-sha:
Expand Down Expand Up @@ -72,6 +72,13 @@ jobs:
# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Before you can enable {% data variables.enterprise.prodname_unified_search %}, y
{% data reusables.enterprise-accounts.github-connect-tab %}
1. To the right of "Unified search", click **Enable**.

![Screenshot of the "Unified search" option on the GitHub Connect page. The "Enable" button is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/github-dotcom-enable-search.png)
![Screenshot of the "Unified search" for public repositories option. The "Enable" button is outlined in orange.](/assets/images/enterprise/site-admin-settings/github-dotcom-enable-search.png)
1. Optionally, to the right of "Users can search private repositories on ENTERPRISE ACCOUNT when searching from Enterprise Server", click **Enable**.

![Screenshot of the "Unified search" option on the GitHub Connect page. To the right of the setting to allow search of private repositories, the "Enable" button is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/enable-private-search.png)
![Screenshot of the "Unified search" option for private repositories. To the right of the setting, the "Enable" button is outlined in orange.](/assets/images/enterprise/site-admin-settings/enable-private-search.png)
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Across all organizations owned by your enterprise, you can allow members to see
1. Under "Allow members to see the comment author's profile name in public and internal repositories", select the dropdown menu and click a policy.
1. Optionally, to enforce the display of profile names for all repositories in your enterprise, select **Enforce for all repositories on the instance**.

![Screenshot of the "Allow members to see the comment author's profile name in public and internal repositories" policy section. The "Enforce on all repositories" checkbox is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/enforce-for-all-repositories-option.png)
![Screenshot of the policy option for the display of member names in your repositories. The "Enforce on all repositories" checkbox is outlined.](/assets/images/enterprise/site-admin-settings/enforce-for-all-repositories-option.png)

{% endif %}

Expand Down Expand Up @@ -336,7 +336,7 @@ If necessary, you can prevent repository administrators from changing anonymous
{% data reusables.enterprise_site_admin_settings.admin-top-tab %}
1. Under "Danger Zone", next to "Enable Anonymous Git read access", click **Enable**.

![Screenshot of the "Danger Zone" section of a repository's site admin settings. To the right of "Enable anonymous Git read access", the "Enable" button is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/site-admin-enable-anonymous-git-read-access.png)
![Screenshot of the "Enable anonymous Git read access" setting. The "Enable" button is outlined.](/assets/images/enterprise/site-admin-settings/site-admin-enable-anonymous-git-read-access.png)
1. Review the changes. To confirm, click **Yes, enable anonymous Git read access.**
1. Optionally, to prevent repository admins from changing this setting for this repository, select **Prevent repository admins from disabling anonymous Git read access**.
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ There are several types of user messages.
{% data reusables.enterprise-accounts.messages-tab %}
1. To the right of "Sign in page", click **Add message** or **Edit message**.

![Screenshot of the "Sign in page" section of the "Messages" settings. A button, labeled with a plus icon and "Add message", is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/edit-message.png)
![Screenshot of the "Sign in page" section of the "Messages" settings. A button, labeled with a plus icon and "Add message", is outlined.](/assets/images/enterprise/site-admin-settings/edit-message.png)
1. Under **Sign in message**, type the message you'd like users to see.
{% data reusables.enterprise_site_admin_settings.message-preview-save %}

Expand All @@ -60,7 +60,7 @@ There are several types of user messages.
{% data reusables.enterprise-accounts.messages-tab %}
1. {% ifversion ghes %}To the right of{% else %}Under{% endif %} "Sign out page", click **Add message** or **Edit message**.

![Screenshot of the "Sign out page" section of the "Messages" settings. A button, labeled with a plus icon and "Add message," is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/sign-out-add-message-button.png)
![Screenshot of the "Sign out page" section of the "Messages" settings. A button, labeled with a plus icon and "Add message," is outlined.](/assets/images/enterprise/site-admin-settings/sign-out-add-message-button.png)
1. Under **Sign out message**, type the message you'd like users to see.
{% ifversion ghes %}
{% data reusables.enterprise_site_admin_settings.message-preview-save %}{% else %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ If the existing organization uses billed apps, make sure to remove the billed ap
{%- endif %}
1. Next to the organization you want to transfer, select the {% octicon "kebab-horizontal" width="16" aria-label="Organization settings" %} dropdown menu, then click **Transfer organization**.

![Screenshot of an organization in the organization list. A dropdown menu, labeled with the kebab icon, is expanded and the "Transfer organization" option is highlighted with an orange outline.](/assets/images/help/business-accounts/transfer-organization.png)
![Screenshot of the expanded dropdown menu labeled with the kebab icon, for an organization. The "Transfer organization" option is outlined.](/assets/images/help/business-accounts/transfer-organization.png)

1. Select the **Select enterprise** dropdown menu, start typing the name of the destination enterprise, and click the enterprise you want to transfer the organization to.
1. Click **Review transfer**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ You can also enforce your default setting on all current organization members in
{% data reusables.enterprise-accounts.options-tab %}
1. Under "Default organization membership visibility", select the drop-down menu, and click **Private** or **Public**.
1. Optionally, to prevent members from changing their membership visibility from the default, select **Enforce for all enterprise members**.
![Screenshot of the "Default organization membership visibility" section on the enterprise's policies page. The "Enforce for all enterprise members" checkbox is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/enforce-default-org-membership-visibility-setting.png){% ifversion ghes %}
![Screenshot of the "Default organization membership visibility" section. The "Enforce for all enterprise members" checkbox is outlined.](/assets/images/enterprise/site-admin-settings/enforce-default-org-membership-visibility-setting.png){% ifversion ghes %}
1. If you'd like to enforce your new visibility setting on all existing members, use the `ghe-org-membership-update` command-line utility. For more information, see [AUTOTITLE](/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-org-membership-update).{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ As part of the downgrade to the free plan:
1. In the search bar, begin typing the organization's name until the organization appears in the search results.
1. To the right of the organization's name, select the {% octicon "gear" aria-label="Organization settings" %} dropdown menu and click **Remove organization**.

![Screenshot of a list of organizations in search results. To the right of the organization name, the dropdown menu labeled with a gear icon is expanded, and the "Remove organization" option is highlighted with an orange outline.](/assets/images/help/enterprises/remove-organization.png)
![Screenshot of the expanded dropdown menu labeled with a gear icon, for an organization. The "Remove organization" option is outlined.](/assets/images/help/enterprises/remove-organization.png)
1. Review the warnings, then click **Remove organization**.

## Further reading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ shortTitle: Disable SSH for Git
1. Under "Git SSH access", select the drop-down menu, and click **Disabled**.
1. Select **Enforce on all repositories**.

![Screenshot of the "Git SSH access" section of the site admin page for an organization. The "Enforce on all repositories" checkbox is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/git-ssh-access-organization-setting.png)
![Screenshot of the "Git SSH access" section of the site admin page for an organization. The "Enforce on all repositories" checkbox is outlined.](/assets/images/enterprise/site-admin-settings/git-ssh-access-organization-setting.png)

## Disabling Git SSH access to all repositories in your enterprise

Expand All @@ -61,4 +61,4 @@ shortTitle: Disable SSH for Git
1. Under "Git SSH access", select the drop-down menu, and click **Disabled**.
1. Select **Enforce on all repositories**.

![Screenshot of the "Git SSH access" section on the enterprise's policies page. The "Enforce on all repositories" checkbox is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/git-ssh-access-appliance-setting.png)
![Screenshot of the "Git SSH access" section on the enterprise's policies page. The "Enforce on all repositories" checkbox is outlined.](/assets/images/enterprise/site-admin-settings/git-ssh-access-appliance-setting.png)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Actions you perform during an impersonation session are recorded as events in th
{% data reusables.enterprise_site_admin_settings.click-user %}
1. In the top left of the page, click **User info**.

![Screenshot of the "User info" section of the site admin page for a user. The "User info" heading is highlighted in dark orange. Under the heading, the user is marked as active.](/assets/images/enterprise/stafftools/user-info.png)
![Screenshot of the "User info" section for a user. The "User info" heading is outlined. Under the heading, the user is marked as active.](/assets/images/enterprise/stafftools/user-info.png)
1. Under "Danger Zone", click **Sign in to GitHub as @username**
1. Select a reason from the dropdown list. If you select **Other** you will need to provide additional context in the text field below **Notes**. Click **Begin impersonation** to begin the session.
1. When you are ready to end the impersonation session, click **Return to your mundane life as username** in the banner at the top of the page.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Dormant users are not automatically suspended. Consider suspending dormant users
{% data reusables.enterprise_site_admin_settings.click-user %}
1. In the **User info** section, view the status of the user's account. Any users labeled with "{% octicon "hourglass" aria-hidden="true" %} Dormant" are dormant, and users labeled with "{% octicon "hourglass" aria-hidden="true" %} "Active" are not.

![Screenshot of the "User info" section of the site admin page for a user. The "User info" heading is highlighted in dark orange. Under the heading, the user is marked as active.](/assets/images/enterprise/stafftools/active-user.png)
![Screenshot of the "User info" section for a user. The "User info" heading is outlined. Under the heading, the user is marked as active.](/assets/images/enterprise/stafftools/active-user.png)

## Configuring the dormancy threshold

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Invitations expire after 7 days. You can retry or cancel expired invitations, ei
1. Optionally, retry or cancel a single invitation.
* To the right of the invitation you want to cancel or retry, select the {% octicon "kebab-horizontal" aria-label="Show actions" %} dropdown menu and click **Retry invitation** or **Cancel invitation**.

![Screenshot of a user in the list of failed invitations. A dropdown menu, labeled with a kebab icon, is highlighted with an orange outline.](/assets/images/help/business-accounts/enterprise-invitation-retry-or-cancel.png)
![Screenshot of a user in the list of failed invitations. A dropdown menu labeled with a kebab icon, is outlined.](/assets/images/help/business-accounts/enterprise-invitation-retry-or-cancel.png)
* To confirm, click **Yes, retry** or **Yes, cancel**.

1. Optionally, retry or cancel multiple invitations at the same time.
* Select the checkboxes next to the invitations you want to retry or cancel.
* At the top of the list, select the **X invitations selected** dropdown menu and click **Retry invitations** or **Cancel invitations**.

![Screenshot of the list of failed invitations. The dropdown menu above the list, labeled "2 invitations selected" is highlighted with an orange outline.](/assets/images/help/enterprises/enterprise-invitations-multiple-selection.png)
![Screenshot of the list of failed invitations. The dropdown menu above the list, labeled "2 invitations selected" is outlined.](/assets/images/help/enterprises/enterprise-invitations-multiple-selection.png)
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ You can create a custom message that suspended users will see when attempting to
{% data reusables.enterprise-accounts.messages-tab %}
1. To the right of "Suspended user page", click **Add message**.

![Screenshot of the "Suspend user page" section of the "Messages" settings. A button, labeled with a plus icon and "Add message," is highlighted with an orange outline.](/assets/images/enterprise/site-admin-settings/add-message.png)
![Screenshot of the "Suspend user page" section of the "Messages" settings. A button, labeled with a plus icon and "Add message," is outlined.](/assets/images/enterprise/site-admin-settings/add-message.png)
1. In the "Suspend user message" field, type your message. You can type Markdown, or use the Markdown toolbar to style your message.
1. To see the rendered message, click **Preview**.
{% data reusables.enterprise_site_admin_settings.save-changes %}
Expand Down
Loading