Skip to content

Commit 9748732

Browse files
authored
repo sync
2 parents adc56bb + 4e0db37 commit 9748732

File tree

4 files changed

+97
-6
lines changed

4 files changed

+97
-6
lines changed

.github/workflows/crowdin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
crowdin_branch_name: crowdin-main
3939

4040
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GITHUB_TOKEN: ${{ secrets.OCTOGLOT_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}
4242

4343
# This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string
4444
# See "API v2" on https://crowdin.com/project/<your-project>/settings#api
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: First responder docs-content
2+
on:
3+
pull_request:
4+
types: [reopened, opened, ready_for_review, unlabeled]
5+
6+
jobs:
7+
first-responder-triage:
8+
if: github.repository == 'github/docs-internal' && github.event.pull_request.draft == false && github.event.action != 'unlabeled'
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check if the event originated from a team member
13+
uses: actions/github-script@v2.0.0
14+
id: set-result
15+
with:
16+
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
17+
result-encoding: string
18+
script: |
19+
const repoName = context.payload.repository.name
20+
const ownerName = context.payload.repository.owner.login
21+
const issueNumber = (context.eventName === "issues") ? context.payload.issue.number : context.payload.number
22+
const updatedIssueInformation = await github.issues.get({
23+
owner: ownerName,
24+
repo: repoName,
25+
issue_number: issueNumber
26+
})
27+
const teamMembers = await github.request(
28+
`/orgs/github/teams/docs/members`
29+
)
30+
const logins = teamMembers.data.map(member => member.login)
31+
if (logins.some(login => login === updatedIssueInformation.data.user.login)) {
32+
console.log(`This issue or pull request was authored by a member of the github/docs team.`)
33+
return 'true'
34+
}
35+
console.log(`This issue or pull request was authored by an external contributor.`)
36+
return 'false'
37+
- name: Label external contributor pull requests with docs-content-fr
38+
uses: rachmari/labeler@v1.0.4
39+
if: steps.set-result.outputs.result == 'false'
40+
with:
41+
repo-token: "${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}"
42+
add-labels: "docs-content-fr"
43+
- name: Triage to FR PR project column
44+
uses: rachmari/actions-add-new-issue-to-column@v1.1.1
45+
if: steps.set-result.outputs.result == 'false'
46+
with:
47+
action-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
48+
project-url: "https://github.com/orgs/github/projects/1367"
49+
column-name: "Docs-internal external contributor PRs"
50+
51+
first-responder-label-removed:
52+
if: github.event.label.name == 'docs-content-fr' && github.event.action == 'unlabeled'
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- name: Dump GitHub context
57+
env:
58+
GITHUB_CONTEXT: ${{ toJson(github) }}
59+
run: echo "$GITHUB_CONTEXT"
60+
- name: Remove card from project
61+
uses: actions/github-script@v2.0.0
62+
with:
63+
github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}}
64+
result-encoding: string
65+
script: |
66+
const issueToRemove = context.payload.number
67+
const cards = await github.projects.listCards({
68+
column_id: 11130889
69+
})
70+
cards.data.forEach(card => {
71+
if (card.content_url) {
72+
const cardIssueNumber = parseInt(card.content_url.split('/').pop(), 10)
73+
if (cardIssueNumber === issueToRemove) {
74+
const cards = github.projects.deleteCard({
75+
card_id: card.id
76+
})
77+
}
78+
}
79+
})

content/actions/creating-actions/creating-a-composite-run-steps-action.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Before you begin, you'll create a {% data variables.product.product_name %} repo
3636
echo "Goodbye"
3737
```
3838

39-
1. From your terminal, make `goodbye.sh` executable and check it into your repository.
39+
3. From your terminal, make `goodbye.sh` executable.
4040

4141
```shell
4242
chmod +x goodbye.sh
@@ -85,14 +85,26 @@ Before you begin, you'll create a {% data variables.product.product_name %} repo
8585

8686
For more information about how to use `github.action_path`, see "[`github context`](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)".
8787

88-
1. Create a new label. This example uses a label called `v1` for the main branch. For more information, see "[Creating a label
89-
](/github/managing-your-work-on-github/creating-a-label)."
88+
1. From your terminal, check in your `action.yml` file.
89+
90+
```shell
91+
git add action.yml
92+
git commit -m "Add action"
93+
git push
94+
```
95+
96+
1. From your terminal, add a tag. This example uses a tag called `v1`. For more information, see "[About actions](/actions/creating-actions/about-actions#using-release-management-for-actions)."
97+
98+
```shell
99+
git tag -a -m "Description of this release" v1
100+
git push --follow-tags
101+
```
90102

91103
### Testing out your action in a workflow
92104

93105
The following workflow code uses the completed hello world action that you made in "[Creating an action metadata file](/actions/creating-actions/creating-a-composite-run-steps-action#creating-an-action-metadata-file)".
94106

95-
Copy the workflow code into a `.github/workflows/main.yml` file in another repository, but replace `actions/hello-world-composite-run-steps-action@v1` with the repository and label you created. You can also replace the `who-to-greet` input with your name.
107+
Copy the workflow code into a `.github/workflows/main.yml` file in another repository, but replace `actions/hello-world-composite-run-steps-action@v1` with the repository and tag you created. You can also replace the `who-to-greet` input with your name.
96108

97109
{% raw %}
98110
**.github/workflows/main.yml**

script/preview-openapi-changes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ if [[ $OPTION == "stitch" ]]; then
4848

4949
# Generate the deferenced OpenAPI files from github/github
5050
cd github
51-
bin/dump-openapi-description /tmp/dump
51+
bin/openapi bundle /tmp/dump
5252

5353
# Copy the derefrenced json files into rest-api-operations and build them
5454
cd ../rest-api-operations

0 commit comments

Comments
 (0)