Skip to content

Commit

Permalink
repo sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Octomerger authored Oct 15, 2020
2 parents adc56bb + 4e0db37 commit 9748732
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
crowdin_branch_name: crowdin-main

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/first-responder-docs-content.yml
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/github-script@v2.0.0
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/labeler@v1.0.4
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/actions-add-new-issue-to-column@v1.1.1
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/github-script@v2.0.0
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
})
}
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Before you begin, you'll create a {% data variables.product.product_name %} repo
echo "Goodbye"
```

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

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

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

1. Create a new label. This example uses a label called `v1` for the main branch. For more information, see "[Creating a label
](/github/managing-your-work-on-github/creating-a-label)."
1. From your terminal, check in your `action.yml` file.

```shell
git add action.yml
git commit -m "Add action"
git push
```

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)."

```shell
git tag -a -m "Description of this release" v1
git push --follow-tags
```

### Testing out your action in a workflow

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)".

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

{% raw %}
**.github/workflows/main.yml**
Expand Down
2 changes: 1 addition & 1 deletion script/preview-openapi-changes
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if [[ $OPTION == "stitch" ]]; then

# Generate the deferenced OpenAPI files from github/github
cd github
bin/dump-openapi-description /tmp/dump
bin/openapi bundle /tmp/dump

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

0 comments on commit 9748732

Please sign in to comment.