You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Do not perform this workflow with GitHub employees. This return
31
+
// statement only gets hit if the user is a GitHub employee
32
+
return
33
+
} catch(err) {
34
+
// An error will be thrown if the user is not a GitHub employee
35
+
// If a user is not a GitHub employee, we should check to see if title has at least the minimum required number of words in it and if it does, we can exit the workflow
36
+
37
+
if(titleWordCount > titleWordCountMin) {
38
+
return
39
+
}
40
+
}
41
+
42
+
//
43
+
// Assuming the user is not a GitHub employee and the issue title
44
+
// has the minimum number of words required, proceed.
45
+
//
46
+
47
+
// Close the issue and add the invalid label
48
+
await github.issues.update({
49
+
owner: owner,
50
+
repo: repo,
51
+
issue_number: issue.number,
52
+
labels: ['invalid'],
53
+
state: 'closed'
54
+
});
55
+
56
+
// Comment on the issue
57
+
await github.issues.createComment({
58
+
owner: owner,
59
+
repo: repo,
60
+
issue_number: issue.number,
61
+
body: "This issue appears to have been opened accidentally. I'm going to close it now, but feel free to open a new issue or ask any questions in [discussions](https://github.com/github/docs/discussions)!"
Copy file name to clipboardExpand all lines: content/developers/apps/creating-ci-tests-with-the-checks-api.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -435,7 +435,7 @@ The code above gets the full repository name and the head SHA of the commit from
435
435
436
436
### Step 2.3. Running RuboCop
437
437
438
-
Great! You're cloning the repository and creating check runs using your CI server. Now you'll get into the nitty gritty details of the [RuboCop linter](https://rubocop.readthedocs.io/en/latest/basic_usage/#rubocop-as-a-code-style-checker) and [Checks API annotations](/rest/reference/checks#create-a-check-run).
438
+
Great! You're cloning the repository and creating check runs using your CI server. Now you'll get into the nitty gritty details of the [RuboCop linter](https://docs.rubocop.org/rubocop/usage/basic_usage.html#code-style-checker) and [Checks API annotations](/rest/reference/checks#create-a-check-run).
439
439
440
440
The following code runs RuboCop and saves the style code errors in JSON format. Add this code below the call to `clone_repository` you added in the [previous step](#step-22-cloning-the-repository) and above the code that updates the check run to complete.
441
441
@@ -447,7 +447,7 @@ logger.debug @report
447
447
@output=JSON.parse @report
448
448
```
449
449
450
-
The code above runs RuboCop on all files in the repository's directory. The option `--format json` is a handy way to save a copy of the linting results in a machine-parsable format. See the [RuboCop docs](https://rubocop.readthedocs.io/en/latest/formatters/#json-formatter) for details and an example of the JSON format.
450
+
The code above runs RuboCop on all files in the repository's directory. The option `--format json` is a handy way to save a copy of the linting results in a machine-parsable format. See the [RuboCop docs](https://docs.rubocop.org/rubocop/formatters.html#json-formatter) for details and an example of the JSON format.
451
451
452
452
Because this code stores the RuboCop results in a `@report` variable, it can safely remove the checkout of the repository. This code also parses the JSON so you can easily access the keys and values in your GitHub App using the `@output` variable.
453
453
@@ -588,7 +588,7 @@ This code limits the total number of annotations to 50. But you can modify this
588
588
589
589
When the `offense_count` is zero, the CI test is a `success`. If there are errors, this code sets the conclusion to `neutral` in order to prevent strictly enforcing errors from code linters. But you can change the conclusion to `failure` if you would like to ensure that the check suite fails when there are linting errors.
590
590
591
-
When errors are reported, the code above iterates through the `files` array in the RuboCop report. For each file, it extracts the file path and sets the annotation level to `notice`. You could go even further and set specific warning levels for each type of [RuboCop Cop](https://rubocop.readthedocs.io/en/latest/cops/), but to keep things simpler in this quickstart, all errors are set to a level of `notice`.
591
+
When errors are reported, the code above iterates through the `files` array in the RuboCop report. For each file, it extracts the file path and sets the annotation level to `notice`. You could go even further and set specific warning levels for each type of [RuboCop Cop](https://docs.rubocop.org/rubocop/cops.html), but to keep things simpler in this quickstart, all errors are set to a level of `notice`.
592
592
593
593
This code also iterates through each error in the `offenses` array and collects the location of the offense and error message. After extracting the information needed, the code creates an annotation for each error and stores it in the `annotations` array. Because annotations only support start and end columns on the same line, `start_column` and `end_column` are only added to the `annotation` object if the start and end line values are the same.
594
594
@@ -718,7 +718,7 @@ If the annotations are related to a file already included in the PR, the annotat
718
718
719
719
If you've made it this far, kudos! 👏 You've already created a CI test. In this section, you'll add one more feature that uses RuboCop to automatically fix the errors it finds. You already added the "Fix this" button in the [previous section](#step-25-updating-the-check-run-with-ci-test-results). Now you'll add the code to handle the `requested_action` check run event triggered when someone clicks the "Fix this" button.
720
720
721
-
The RuboCop tool [offers](https://rubocop.readthedocs.io/en/latest/basic_usage/#auto-correcting-offenses) the `--auto-correct` command-line option to automatically fix errors it finds. When you use the `--auto-correct` feature, the updates are applied to the local files on the server. You'll need to push the changes to GitHub after RuboCop does its magic.
721
+
The RuboCop tool [offers](https://docs.rubocop.org/rubocop/usage/basic_usage.html#auto-correcting-offenses) the `--auto-correct` command-line option to automatically fix errors it finds. When you use the `--auto-correct` feature, the updates are applied to the local files on the server. You'll need to push the changes to GitHub after RuboCop does its magic.
722
722
723
723
To push to a repository, your app must have write permissions for "Repository contents." You set that permission back in [Step 2.2. Cloning the repository](#step-22-cloning-the-repository) to **Read & write**, so you're all set.
Copy file name to clipboardExpand all lines: content/github/getting-started-with-github/git-cheatsheet.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,6 @@ versions:
7
7
enterprise-server: '*'
8
8
github-ae: '*'
9
9
---
10
-
Learning all available Git commands at once can be a daunting task. Keep one of our [Git Cheat Sheets](https://services.github.com/on-demand/resources/cheatsheets/) nearby for reference. The Using Git Cheat Sheet is available in several languages. For more information, see the [resources page on the GitHub Services website](https://services.github.com/on-demand/resources/).
10
+
Learning all available Git commands at once can be a daunting task. Our cheat sheets provide a quick reference for the commands you'll use most often: see "[Git Cheat Sheets](https://training.github.com/)." The "Using Git" cheat sheet is available in several languages.
11
11
12
12
In addition, take a look at our [Git and GitHub learning resources](/articles/git-and-github-learning-resources/) page that links to guides, videos and more.
[Adding a bio to your profile](/articles/adding-a-bio-to-your-profile)
41
41
- term: billing cycle
42
42
description: The interval of time for your specific billing plan.
43
43
- term: billing email
@@ -160,8 +160,8 @@
160
160
- term: contributions
161
161
description: >-
162
162
Specific activities on GitHub that will:
163
-
- Add a square to a user's contribution graph: "[What counts as a contribution](https://help.github.com/articles/viewing-contributions-on-your-profile/#what-counts-as-a-contribution)"
164
-
- Add activities to a user's timeline on their profile: "[Contribution activity](https://help.github.com/articles/viewing-contributions-on-your-profile/#contribution-activity)"
163
+
- Add a square to a user's contribution graph: "[What counts as a contribution](/articles/viewing-contributions-on-your-profile/#what-counts-as-a-contribution)"
164
+
- Add activities to a user's timeline on their profile: "[Contribution activity](/articles/viewing-contributions-on-your-profile/#contribution-activity)"
165
165
- term: contributor
166
166
description: >-
167
167
A contributor is someone who does not have collaborator access to a repository but has contributed to a project and had a pull request they opened merged into the repository.
@@ -230,7 +230,7 @@
230
230
description: >-
231
231
A branch used to experiment with a new feature or fix an issue that is not in production. Also called a topic branch.
232
232
- term: fenced code block
233
-
description: An indented block of code you can create with GitHub Flavored Markdown using triple backticks \`\`\` before and after the code block. See this [example](https://help.github.com/en/articles/creating-and-highlighting-code-blocks#fenced-code-blocks).
233
+
description: An indented block of code you can create with GitHub Flavored Markdown using triple backticks \`\`\` before and after the code block. See this [example](/articles/creating-and-highlighting-code-blocks#fenced-code-blocks).
234
234
- term: fetch
235
235
description: >-
236
236
When you use `git fetch`, you're adding changes from the remote repository to
0 commit comments