Skip to content

Commit 2177ad1

Browse files
authored
Merge branch 'main' into 3634-dependabot-combined-notification
2 parents 36bf562 + 8a750db commit 2177ad1

16 files changed

Lines changed: 198 additions & 157 deletions

File tree

.github/workflows/repo-freeze-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: Repo Freeze Check
22

33
on:
4-
pull_request:
4+
workflow_dispatch:
5+
pull_request_target:
56
types:
67
- opened
78
- reopened

.github/workflows/repo-sync-stalls.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
})
6161
- name: Send Slack notification if workflow fails
6262
uses: someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd
63-
if: failure()
63+
if: ${{ failure() && env.FREEZE != 'true' }}
6464
with:
6565
channel: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
6666
bot-token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,31 @@ versions:
1212

1313
{% data reusables.repositories.actions-workflow-status-badge-into %}
1414

15-
If your workflow uses the `name` keyword, you must reference the workflow by name. If the name of your workflow contains white space, you'll need to replace the space with the URL encoded string `%20`. For more information about the `name` keyword, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/articles/workflow-syntax-for-github-actions#name)."
15+
You reference the workflow by the name of your workflow file.
1616

1717
```
18-
https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_NAME>/badge.svg
18+
https://github.com/<OWNER>/<REPOSITORY>/actions/workflows/<WORKFLOW_FILE>/badge.svg
1919
```
20+
### Using the workflow file name
2021

21-
Alternatively, if your workflow doesn't have a `name`, you must reference the workflow file using the file path relative to the repository's root directory.
22-
23-
{% note %}
24-
25-
**Note:** Referencing the workflow file using the file path does not work if the workflow has a `name`.
26-
27-
{% endnote %}
28-
29-
```
30-
https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_FILE_PATH>/badge.svg
31-
```
32-
33-
### Using a workflow name
34-
35-
This Markdown example adds a status badge for a workflow with the name "Greet Everyone." The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`.
36-
37-
```markdown
38-
![example workflow name](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg)
39-
```
40-
41-
### Using a workflow file path
42-
43-
This Markdown example adds a status badge for a workflow with the file path `.github/workflows/main.yml`. The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`.
22+
This Markdown example adds a status badge for a workflow with the file path `.github/workflows/main.yml`. The `OWNER` of the repository is the `github` organization and the `REPOSITORY` name is `docs`.
4423

4524
```markdown
46-
![example workflow file path](https://github.com/actions/hello-world/workflows/.github/workflows/main.yml/badge.svg)
25+
![example workflow](https://github.com/github/docs/actions/workflows/main.yml/badge.svg)
4726
```
4827

4928
### Using the `branch` parameter
5029

5130
This Markdown example adds a status badge for a branch with the name `feature-1`.
5231

5332
```markdown
54-
![example branch parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?branch=feature-1)
33+
![example branch parameter](https://github.com/github/docs/actions/workflows/main.yml/badge.svg?branch=feature-1)
5534
```
5635

5736
### Using the `event` parameter
5837

5938
This Markdown example adds a badge that displays the status of workflow runs triggered by the `pull_request` event.
6039

6140
```markdown
62-
![example event parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?event=pull_request)
41+
![example event parameter](https://github.com/github/docs/actions/workflows/main.yml/badge.svg?event=pull_request)
6342
```

content/actions/reference/events-that-trigger-workflows.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,12 @@ on:
271271
deployment_status
272272
```
273273

274+
{% note %}
275+
276+
**Note:** When a deployment status's state is set to `inactive`, a webhook event will not be created.
277+
278+
{% endnote %}
279+
274280
#### `fork`
275281

276282
Runs your workflow anytime when someone forks a repository, which triggers the `fork` event. For information about the REST API, see "[Create a fork](/rest/reference/repos#create-a-fork)."

content/actions/reference/workflow-syntax-for-github-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ versions:
1717

1818
### About YAML syntax for workflows
1919

20-
Workflow files use YAML syntax, and must have either a `.yml` or `.yaml` file extension. If you're new to YAML and want to learn more, see "[Learn YAML in five minutes](https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes)."
20+
Workflow files use YAML syntax, and must have either a `.yml` or `.yaml` file extension. {% data reusables.actions.learn-more-about-yaml %}
2121

2222
You must store workflow files in the `.github/workflows` directory of your repository.
2323

data/release-notes/3-0/0.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
date: '2021-02-16'
2+
intro: The minimum infrastructure requirements have increased for {% data variables.product.prodname_ghe_server %} 3.0+. For more information, see "[About minimum requirements for GitHub Enterprise Server 3.0 and later](/admin/enterprise-management/upgrading-github-enterprise-server#about-minimum-requirements-for-github-enterprise-server-30-and-later)."
23
sections:
34
features:
45
- heading: GitHub Actions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
If you're new to YAML and want to learn more, see "[Learn YAML in five minutes](https://www.codeproject.com/Articles/1214409/Learn-YAML-in-five-minutes)."

data/ui.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ helpfulness:
4848
yes_feedback: Want to learn about new docs features and updates? Sign up for updates!
4949
email_placeholder: email@example.com
5050
no_feedback: We're continually improving our docs. We'd love to hear how we can do better.
51-
category_label: What problem did you have?
52-
category_default: Choose an option
53-
category_unclear: Information was unclear
54-
category_confusing: The content was confusing
55-
category_unhelpful: The article didn't answer my question
56-
category_other: Other
5751
comment_label: Let us know what we can do better
5852
optional: Optional
5953
required: Required

includes/helpfulness.html

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -52,38 +52,6 @@
5252
name="helpfulness-token"
5353
aria-hidden="true"
5454
/>
55-
<p hidden data-help-no>
56-
<label
57-
class="d-block mb-1 f6"
58-
for="helpfulness-category"
59-
>
60-
{% data ui.helpfulness.category_label %}
61-
<span class="text-normal text-gray-light float-right ml-1">
62-
{% data ui.helpfulness.required %}
63-
</span>
64-
</label>
65-
<select
66-
class="form-control select-sm width-full"
67-
name="helpfulness-category"
68-
id="helpfulness-category"
69-
>
70-
<option value="">
71-
{% data ui.helpfulness.category_default %}
72-
</option>
73-
<option value="Unclear">
74-
{% data ui.helpfulness.category_unclear %}
75-
</option>
76-
<option value="Confusing">
77-
{% data ui.helpfulness.category_confusing %}
78-
</option>
79-
<option value="Unhelpful">
80-
{% data ui.helpfulness.category_unhelpful %}
81-
</option>
82-
<option value="Other">
83-
{% data ui.helpfulness.category_other %}
84-
</option>
85-
</select>
86-
</p>
8755
<p hidden data-help-no>
8856
<label
8957
class="d-block mb-1 f6"

javascripts/experiment.js

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import murmur from 'imurmurhash'
22
import { getUserEventsId, sendEvent } from './events'
3-
// import h from './hyperscript'
3+
import h from './hyperscript'
4+
5+
import { updateDisplay, submitForm } from './helpfulness'
46

57
const TREATMENT = 'TREATMENT'
68
const CONTROL = 'CONTROL'
@@ -11,7 +13,7 @@ export function bucket (test) {
1113
return hash % 2 ? TREATMENT : CONTROL
1214
}
1315

14-
export async function sendSuccess (test) {
16+
export function sendSuccess (test) {
1517
return sendEvent({
1618
type: 'experiment',
1719
experiment_name: test,
@@ -21,8 +23,85 @@ export async function sendSuccess (test) {
2123
}
2224

2325
export default function () {
26+
// *** Example test code ***
2427
// const testName = '$test-name$'
2528
// const xbucket = bucket(testName)
26-
// if (xbucket === TREATMENT) { ... }
29+
// const x = document.querySelector(...)
2730
// x.addEventListener('click', () => { sendSuccess(testName) })
31+
// if (xbucket === TREATMENT) applyTreatment(x)
32+
33+
const testName = 'survey-stars'
34+
const xbucket = bucket(testName)
35+
36+
const form = document.querySelector('.js-helpfulness')
37+
if (!form) return
38+
39+
// Overwrites the default handler for helpfulness survey...
40+
form.addEventListener('submit', evt => {
41+
evt.preventDefault()
42+
sendSuccess(testName)
43+
submitForm(form)
44+
updateDisplay(form, 'end')
45+
})
46+
47+
if (xbucket === TREATMENT) applyTreatment(form)
48+
}
49+
50+
function applyTreatment (form) {
51+
const p = form.querySelector('.radio-group')
52+
p.innerHTML = ''
53+
54+
const buttons = [1, 2, 3, 4, 5].map(i =>
55+
h(
56+
'button',
57+
{
58+
'data-value': i,
59+
'aria-label': i,
60+
class: 'btn-link tooltipped tooltipped-n'
61+
},
62+
h(
63+
'span',
64+
{
65+
class: 'star-empty f3'
66+
},
67+
'☆'
68+
),
69+
h(
70+
'span',
71+
{
72+
class: 'star-full f3',
73+
hidden: true
74+
},
75+
'★'
76+
)
77+
)
78+
)
79+
const input = h('input', {
80+
name: 'helpfulness-vote',
81+
type: 'hidden'
82+
})
83+
buttons.forEach(btn => p.appendChild(btn))
84+
p.appendChild(input)
85+
86+
buttons.forEach((btn, i) => {
87+
btn.addEventListener('click', evt => {
88+
evt.preventDefault()
89+
updateBtnDisplay(i)
90+
submitForm(form)
91+
updateDisplay(form, i > 2 ? 'yes' : 'no')
92+
})
93+
})
94+
95+
function updateBtnDisplay (i) {
96+
buttons.forEach((xbtn, xi) => {
97+
if (xi <= i) {
98+
xbtn.querySelector('.star-full').removeAttribute('hidden')
99+
xbtn.querySelector('.star-empty').setAttribute('hidden', true)
100+
} else {
101+
xbtn.querySelector('.star-full').setAttribute('hidden', true)
102+
xbtn.querySelector('.star-empty').removeAttribute('hidden')
103+
}
104+
})
105+
input.setAttribute('value', i > 2 ? 'Yes' : 'No')
106+
}
28107
}

0 commit comments

Comments
 (0)