Skip to content

Commit fcc843e

Browse files
authored
repo sync
2 parents ce7f9e8 + a8bfd0a commit fcc843e

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

.github/workflows/triage-unallowed-contributions.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
name: Check unallowed file changes
22

33
on:
4-
push:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/**'
7+
- '.github/CODEOWNERS'
8+
- 'translations/**'
9+
- 'assets/fonts/**'
10+
- 'data/graphql/**'
11+
- 'lib/graphql/**'
12+
- 'lib/redirects/**'
13+
- 'lib/rest/**'
14+
- 'lib/webhooks/**'
515

616
jobs:
717
triage:
8-
if: github.repository == 'github/docs' && github.event.pull_request.pull_request.user.login != 'Octomerger'
18+
if: github.repository == 'github/docs' && github.event.pull_request.user.login != 'Octomerger'
919
runs-on: ubuntu-latest
1020
steps:
1121
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
12-
- name: Get pull request number
13-
id: pull-number
14-
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
15-
with:
16-
github-token: ${{secrets.GITHUB_TOKEN}}
17-
result-encoding: string
18-
script: |
19-
const pulls = await github.repos.listPullRequestsAssociatedWithCommit({
20-
...context.repo,
21-
commit_sha: context.sha
22-
})
23-
24-
return pulls.data.map(pull => pull.number).shift()
2522
- name: Check for existing requested changes
2623
id: requested-change
2724
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
@@ -31,13 +28,19 @@ jobs:
3128
script: |
3229
const pullReviews = await github.pulls.listReviews({
3330
...context.repo,
34-
pull_number: ${{steps.pull-number.outputs.result}}
31+
pull_number: context.payload.number
3532
})
3633
37-
return pullReviews.data
34+
const botReviews = pullReviews.data
3835
.filter(review => review.user.login === 'github-actions[bot]')
3936
.sort((a, b) => new Date(b.submitted_at) - new Date(a.submitted_at))
4037
.shift()
38+
39+
if (botReviews) {
40+
console.log(`Pull request reviews authored by the github-action bot: ${botReviews}`)
41+
}
42+
return botReviews
43+
4144
- name: Get files changed
4245
uses: dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58
4346
id: filter
@@ -89,29 +92,31 @@ jobs:
8992
if (translationFiles.length > 0) {
9093
await github.issues.addLabels({
9194
...context.repo,
92-
issue_number: ${{steps.pull-number.outputs.result}},
95+
issue_number: context.payload.number,
9396
labels: ['localization']
9497
})
9598
reviewMessage += "\n\nIt looks like you've modified translated content. Unfortunately, we are not able to accept pull requests for translated content. Our translation process involves an integration with an external service at crowdin.com, where all translation activity happens. We hope to eventually open up the translation process to the open source community, but we're not there yet. See https://github.com/github/docs/blob/main/CONTRIBUTING.md#earth_asia-translations for more details."
9699
}
97100
98101
await github.pulls.createReview({
99102
...context.repo,
100-
pull_number: ${{steps.pull-number.outputs.result}},
103+
pull_number: context.payload.number,
101104
body: reviewMessage,
102105
event: 'REQUEST_CHANGES'
103106
})
104107
# When the most recent review was CHANGES_REQUESTED and the existing
105108
# PR no longer contains unallowed changes, dismiss the previous review
106109
- name: Dismiss pull request review
107-
if: ${{ steps.filter.outputs.notAllowed == 'false' && fromJson(steps.requested-change.outputs.result).state == 'CHANGES_REQUESTED' }}
110+
# Check that unallowed files aren't modified and that a
111+
# CHANGES_REQUESTED review already exists
112+
if: ${{ steps.filter.outputs.notAllowed == 'false' && steps.requested-change.outputs.result && fromJson(steps.requested-change.outputs.result).state == 'CHANGES_REQUESTED' }}
108113
uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
109114
with:
110115
github-token: ${{secrets.GITHUB_TOKEN}}
111116
script: |
112117
await github.pulls.dismissReview({
113118
...context.repo,
114-
pull_number: ${{steps.pull-number.outputs.result}},
119+
pull_number: context.payload.number,
115120
review_id: ${{fromJson(steps.requested-change.outputs.result).id}},
116121
message: `✨Looks like you reverted all files we don't accept contributions for. 🙌 A member of the docs team will review your PR soon. 🚂`
117122
})

content/desktop/installing-and-configuring-github-desktop/keyboard-shortcuts.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ GitHub Desktop keyboard shortcuts on macOS
5151
|<kbd>⌘</kbd><kbd>2</kbd> | Show your commit history
5252
|<kbd>⌘</kbd><kbd>B</kbd> | Show all your branches
5353
|<kbd>⌘</kbd><kbd>G</kbd> | Go to the commit summary field
54+
|<kbd>⌘</kbd><kbd>Enter</kbd> | Commit changes when summary or description field is active
5455
|<kbd>space</kbd>| Select or deselect all highlighted files
5556
|<kbd>⇧</kbd><kbd>⌘</kbd><kbd>N</kbd> | Create a new branch
5657
|<kbd>⇧</kbd><kbd>⌘</kbd><kbd>R</kbd> | Rename the current branch
@@ -104,6 +105,7 @@ GitHub Desktop keyboard shortcuts on Windows
104105
|<kbd>Ctrl</kbd><kbd>2</kbd> | Show your commit history
105106
|<kbd>Ctrl</kbd><kbd>B</kbd> | Show all your branches
106107
|<kbd>Ctrl</kbd><kbd>G</kbd> | Go to the commit summary field
108+
|<kbd>Ctrl</kbd><kbd>Enter</kbd> | Commit changes when summary or description field is active
107109
|<kbd>space</kbd>| Select or deselect all highlighted files
108110
|<kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>N</kbd> | Create a new branch
109111
|<kbd>Ctrl</kbd><kbd>Shift</kbd><kbd>R</kbd> | Rename the current branch

0 commit comments

Comments
 (0)