forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
125 changed files
with
795 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,10 @@ module.exports = [ | |
'actions/setup-node@v1', | ||
'actions/setup-ruby@v1', | ||
'actions/stale@v3', | ||
'crowdin/[email protected]', | ||
'dawidd6/action-delete-branch@v3', | ||
'docker://chinthakagodawita/autoupdate-action:v1', | ||
'fkirc/skip-duplicate-actions@a12175f6209d4805b5a163d723270be2a0dc7b36', | ||
'github/codeql-action/analyze@v1', | ||
'github/codeql-action/init@v1', | ||
'ianwalter/[email protected]', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,40 @@ | ||
name: Browser Tests | ||
|
||
on: [push] | ||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
see_if_should_skip: | ||
runs-on: ubuntu-latest | ||
# Map a step output to a job output | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@a12175f6209d4805b5a163d723270be2a0dc7b36 | ||
with: | ||
cancel_others: 'false' | ||
github_token: ${{ github.token }} | ||
paths: '["assets/**", "content/**", "data/**", "includes/**", "javascripts/**", "jest-puppeteer.config.js", "jest.config.js", "layouts/**", "lib/**", "middleware/**", "package-lock.json", "package.json", "server.js", "translations/**", "webpack.config.js"]' | ||
build: | ||
needs: see_if_should_skip | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
# Each of these ifs needs to be repeated at each step to make sure the required check still runs | ||
# Even if if doesn't do anything | ||
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }} | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install | ||
|
||
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }} | ||
name: Install | ||
uses: ianwalter/[email protected] | ||
with: | ||
args: npm ci | ||
- name: Test | ||
|
||
- if: ${{ needs.see_if_should_skip.outputs.should_skip == 'false' }} | ||
name: Test | ||
uses: ianwalter/[email protected] | ||
with: | ||
args: npm run browser-test | ||
args: npm run browser-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Please ping @github/docs-localization in the PR whenever you update this file! | ||
|
||
name: Crowdin Sync | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
sync_with_crowdin: | ||
name: Sync with Crowdin | ||
if: github.repository == 'github/docs-internal' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Sync | ||
uses: crowdin/[email protected] | ||
with: | ||
upload_translations: false | ||
download_translations: true | ||
create_pull_request: true | ||
|
||
# Using a custom config temporarily to avoid clobbering the existing crowdin.yml | ||
# that is used by the github-help-docs OAuth integration. | ||
config: 'crowdin-actions-config.yml' | ||
|
||
# This is the name of the git branch that Crowdin will create when opening a pull request. | ||
# This branch does NOT need to be manually created. It will be created automatically by the action. | ||
localization_branch_name: automated-crowdin-translations | ||
|
||
# This is the name of the top-level directory that Crowdin will use for files. | ||
# Note that this is not a "branch" in the git sense, but more like a top-level directory in your Crowdin project. | ||
# This branch does NOT need to be manually created. It will be created automatically by the action. | ||
crowdin_branch_name: crowdin-main | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.OCTOGLOT_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} | ||
|
||
# This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string | ||
# See "API v2" on https://crowdin.com/project/<your-project>/settings#api | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
|
||
# A personal access token, not to be confused with Crowdin API v1 "API key" | ||
# See https://crowdin.com/settings#api-key to generate a token | ||
# This token was created by logging into Crowdin with the octoglot user | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: First responder docs-content | ||
on: | ||
pull_request: | ||
types: [reopened, opened, ready_for_review, unlabeled] | ||
|
||
jobs: | ||
first-responder-triage: | ||
if: github.repository == 'github/docs-internal' && github.event.pull_request.draft == false && github.event.action != 'unlabeled' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check if the event originated from a team member | ||
uses: actions/[email protected] | ||
id: set-result | ||
with: | ||
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}} | ||
result-encoding: string | ||
script: | | ||
const repoName = context.payload.repository.name | ||
const ownerName = context.payload.repository.owner.login | ||
const issueNumber = (context.eventName === "issues") ? context.payload.issue.number : context.payload.number | ||
const updatedIssueInformation = await github.issues.get({ | ||
owner: ownerName, | ||
repo: repoName, | ||
issue_number: issueNumber | ||
}) | ||
const teamMembers = await github.request( | ||
`/orgs/github/teams/docs/members` | ||
) | ||
const logins = teamMembers.data.map(member => member.login) | ||
if (logins.some(login => login === updatedIssueInformation.data.user.login)) { | ||
console.log(`This issue or pull request was authored by a member of the github/docs team.`) | ||
return 'true' | ||
} | ||
console.log(`This issue or pull request was authored by an external contributor.`) | ||
return 'false' | ||
- name: Label external contributor pull requests with docs-content-fr | ||
uses: rachmari/[email protected] | ||
if: steps.set-result.outputs.result == 'false' | ||
with: | ||
repo-token: "${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}" | ||
add-labels: "docs-content-fr" | ||
- name: Triage to FR PR project column | ||
uses: rachmari/[email protected] | ||
if: steps.set-result.outputs.result == 'false' | ||
with: | ||
action-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }} | ||
project-url: "https://github.com/orgs/github/projects/1367" | ||
column-name: "Docs-internal external contributor PRs" | ||
|
||
first-responder-label-removed: | ||
if: github.event.label.name == 'docs-content-fr' && github.event.action == 'unlabeled' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
- name: Remove card from project | ||
uses: actions/[email protected] | ||
with: | ||
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}} | ||
result-encoding: string | ||
script: | | ||
const issueToRemove = context.payload.number | ||
const cards = await github.projects.listCards({ | ||
column_id: 11130889 | ||
}) | ||
cards.data.forEach(card => { | ||
if (card.content_url) { | ||
const cardIssueNumber = parseInt(card.content_url.split('/').pop(), 10) | ||
if (cardIssueNumber === issueToRemove) { | ||
const cards = github.projects.deleteCard({ | ||
card_id: card.id | ||
}) | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
on: | ||
pull_request: | ||
pull_request_target: | ||
types: ['closed'] | ||
|
||
jobs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.