diff --git a/.github/workflows/triage-unallowed-contributions.yml b/.github/workflows/triage-unallowed-contributions.yml index cb2e22b06710..c89214f6de56 100644 --- a/.github/workflows/triage-unallowed-contributions.yml +++ b/.github/workflows/triage-unallowed-contributions.yml @@ -1,27 +1,24 @@ name: Check unallowed file changes on: - push: + pull_request: + paths: + - '.github/workflows/**' + - '.github/CODEOWNERS' + - 'translations/**' + - 'assets/fonts/**' + - 'data/graphql/**' + - 'lib/graphql/**' + - 'lib/redirects/**' + - 'lib/rest/**' + - 'lib/webhooks/**' jobs: triage: - if: github.repository == 'github/docs' && github.event.pull_request.pull_request.user.login != 'Octomerger' + if: github.repository == 'github/docs' && github.event.pull_request.user.login != 'Octomerger' runs-on: ubuntu-latest steps: - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - - name: Get pull request number - id: pull-number - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - result-encoding: string - script: | - const pulls = await github.repos.listPullRequestsAssociatedWithCommit({ - ...context.repo, - commit_sha: context.sha - }) - - return pulls.data.map(pull => pull.number).shift() - name: Check for existing requested changes id: requested-change uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 @@ -31,13 +28,19 @@ jobs: script: | const pullReviews = await github.pulls.listReviews({ ...context.repo, - pull_number: ${{steps.pull-number.outputs.result}} + pull_number: context.payload.number }) - return pullReviews.data + const botReviews = pullReviews.data .filter(review => review.user.login === 'github-actions[bot]') .sort((a, b) => new Date(b.submitted_at) - new Date(a.submitted_at)) .shift() + + if (botReviews) { + console.log(`Pull request reviews authored by the github-action bot: ${botReviews}`) + } + return botReviews + - name: Get files changed uses: dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58 id: filter @@ -89,7 +92,7 @@ jobs: if (translationFiles.length > 0) { await github.issues.addLabels({ ...context.repo, - issue_number: ${{steps.pull-number.outputs.result}}, + issue_number: context.payload.number, labels: ['localization'] }) 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." @@ -97,21 +100,23 @@ jobs: await github.pulls.createReview({ ...context.repo, - pull_number: ${{steps.pull-number.outputs.result}}, + pull_number: context.payload.number, body: reviewMessage, event: 'REQUEST_CHANGES' }) # When the most recent review was CHANGES_REQUESTED and the existing # PR no longer contains unallowed changes, dismiss the previous review - name: Dismiss pull request review - if: ${{ steps.filter.outputs.notAllowed == 'false' && fromJson(steps.requested-change.outputs.result).state == 'CHANGES_REQUESTED' }} + # Check that unallowed files aren't modified and that a + # CHANGES_REQUESTED review already exists + if: ${{ steps.filter.outputs.notAllowed == 'false' && steps.requested-change.outputs.result && fromJson(steps.requested-change.outputs.result).state == 'CHANGES_REQUESTED' }} uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | await github.pulls.dismissReview({ ...context.repo, - pull_number: ${{steps.pull-number.outputs.result}}, + pull_number: context.payload.number, review_id: ${{fromJson(steps.requested-change.outputs.result).id}}, message: `✨Looks like you reverted all files we don't accept contributions for. 🙌 A member of the docs team will review your PR soon. 🚂` }) diff --git a/content/desktop/installing-and-configuring-github-desktop/keyboard-shortcuts.md b/content/desktop/installing-and-configuring-github-desktop/keyboard-shortcuts.md index 65d9855c81ba..e4faef656722 100644 --- a/content/desktop/installing-and-configuring-github-desktop/keyboard-shortcuts.md +++ b/content/desktop/installing-and-configuring-github-desktop/keyboard-shortcuts.md @@ -51,6 +51,7 @@ GitHub Desktop keyboard shortcuts on macOS |⌘2 | Show your commit history |⌘B | Show all your branches |⌘G | Go to the commit summary field +|⌘Enter | Commit changes when summary or description field is active |space| Select or deselect all highlighted files |⇧⌘N | Create a new branch |⇧⌘R | Rename the current branch @@ -104,6 +105,7 @@ GitHub Desktop keyboard shortcuts on Windows |Ctrl2 | Show your commit history |CtrlB | Show all your branches |CtrlG | Go to the commit summary field +|CtrlEnter | Commit changes when summary or description field is active |space| Select or deselect all highlighted files |CtrlShiftN | Create a new branch |CtrlShiftR | Rename the current branch