Skip to content

Commit a958bed

Browse files
committed
actions
1 parent 0a39af1 commit a958bed

File tree

10 files changed

+191
-24
lines changed

10 files changed

+191
-24
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false

.github/ISSUE_TEMPLATE/fix-content.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Improve an existing article's content
22
description: Make a suggestion to improve the content of an existing article
3+
title: "[Content]: "
34
labels:
45
- content
6+
- triage
57
body:
68
- type: markdown
79
attributes:
@@ -11,10 +13,10 @@ body:
1113
# - type: checkboxes
1214
# id: terms
1315
# attributes:
14-
- type: textarea
16+
- type: input
1517
attributes:
1618
label: What article on segment.com/docs is affected?
17-
description: Please link to the article you'd like to see updated.
19+
description: Please paste link to the article you'd like to see updated.
1820
validations:
1921
required: true
2022

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Display bug or other issue
2+
description: Rais an issue related to the display of the site it self, or anything else not related to content.
3+
title: "[Bug]: "
4+
labels:
5+
- bug
6+
- triage
7+
body:
8+
- type: markdown
9+
attributes:
10+
vallue: |
11+
* Please check that there is not an existing open [issue](https://github.com/segmentio/segment-docs/issues) before you create a new one.
12+
* Read the Contribution guide before you continue.
13+
# - type: checkboxes
14+
# id: terms
15+
# attributes:
16+
- type: input
17+
attributes:
18+
label: Where on segment.com/docs did you see this issue?
19+
description: Please paste link to the article where you noticed the issue.
20+
validations:
21+
required: true
22+
- type: dropdown
23+
id: browsers
24+
attributes:
25+
label: What browsers are you seeing the problem on?
26+
multiple: true
27+
options:
28+
- Firefox
29+
- Chrome
30+
- Safari
31+
- Microsoft Edge

.github/workflows/check-links.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: CheckLinks
2+
3+
# **What it does**: Runs a weekly check for broken internal links.
4+
# **Why we have it**: We want to make sure that pages we link to work.
5+
# **Who does it impact**: Everyone
6+
7+
8+
49
on:
510
schedule:
611
- cron: "5 4 * * SAT"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Merged notification
2+
3+
# **What it does**: When we merge an open-source pull request, we want to set expectations that deployment may take awhile.
4+
# **Why we have it**: Merged PRs go into a queue, not straight to build.
5+
# **Who does it impact**: Open-source contributors.
6+
7+
on:
8+
pull_request_target:
9+
types:
10+
- 'closed'
11+
12+
jobs:
13+
comment:
14+
if: github.repository == 'segmentio/segment-docs' && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
18+
with:
19+
script: |
20+
github.issues.createComment({
21+
...context.repo,
22+
issue_number: context.payload.pull_request.number,
23+
body: "Thank you for your contribution! Your pull request is merged, but may take a day or two to appear on the site."
24+
})

.github/workflows/stale-check.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 60 Days Stale Check
2+
3+
# **What it does**: Pull requests older than 60 days will be flagged as stale.
4+
# **Why we have it**: We want to manage our queue of issues and pull requests.
5+
# **Who does it impact**: Everyone who responds to issues and PRs.
6+
7+
on:
8+
schedule:
9+
- cron: '40 16 * * *' # Run each day at 16:40 UTC / 8:40 PST
10+
11+
jobs:
12+
stale:
13+
if: github.repository == 'segmentio/segment-docs'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/stale@9d6f46564a515a9ea11e7762ab3957ee58ca50da
17+
with:
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.'
20+
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity.'
21+
days-before-stale: 60
22+
days-before-close: -1
23+
only-labels: 'triage'
24+
stale-issue-label: 'stale'
25+
stale-pr-label: 'stale'
26+
exempt-pr-labels: 'never-stale'
27+
exempt-issue-labels: 'never-stale'
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Check unallowed file changes
2+
3+
# **What it does**: If someone changes some files in the open repo, we prevent the pull request from merging.
4+
# **Why we have it**: Some files can only be changed in the internal repository for security and workflow reasons.
5+
# **Who does it impact**: Open source contributors.
6+
7+
on:
8+
pull_request_target:
9+
paths:
10+
- '.github/**'
11+
- '_plugins/**'
12+
- 'analytics/**'
13+
- 'js/**'
14+
- 'scripts/**'
15+
- 'vale-styles/**'
16+
- '_config.yml'
17+
- 'gemfile'
18+
- 'yarn.lock'
19+
- '.vale.ini'
20+
- 'netlify.toml'
21+
- 'package.json'
22+
23+
jobs:
24+
triage:
25+
if: github.repository == 'github/docs' && github.event.pull_request.user.login != ['markzegarelli','stayseesong', 'pwseg']
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Get files changed
29+
uses: dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58
30+
id: filter
31+
with:
32+
# Base branch used to get changed files
33+
base: 'develop'
34+
35+
# Enables setting an output in the format in `${FILTER_NAME}_files
36+
# with the names of the matching files formatted as JSON array
37+
list-files: json
38+
39+
# Returns list of changed files matching each filter
40+
filters: |
41+
notAllowed:
42+
- '.github/**'
43+
- '_plugins/**'
44+
- 'analytics/**'
45+
- 'js/**'
46+
- 'scripts/**'
47+
- 'vale-styles/**'
48+
- '_config.yml'
49+
- 'gemfile'
50+
- 'yarn.lock'
51+
- '.vale.ini'
52+
- 'netlify.toml'
53+
- 'package.json'
54+
55+
# When there are changes to files we can't accept, leave a comment
56+
# explaining this to the PR author
57+
- name: "Comment about changes we can't accept"
58+
if: ${{ steps.filter.outputs.notAllowed }}
59+
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
60+
with:
61+
github-token: ${{secrets.GITHUB_TOKEN}}
62+
script: |
63+
const badFilesArr = [
64+
'.github/**',
65+
'_plugins/**',
66+
'analytics/**',
67+
'js/**',
68+
'scripts/**',
69+
'vale-styles/**',
70+
'_config.yml',
71+
'gemfile',
72+
'yarn.lock',
73+
'.vale.ini',
74+
'netlify.toml',
75+
'package.json'
76+
]
77+
78+
const badFiles = badFilesArr.join('\n')
79+
80+
let reviewMessage = `👋 Hello. It looks like you've modified some files that we can't accept as contributions. The complete list of files we can't accept are:\n${badFiles}\n\nPlease revert all files in this list and resubmit your pull request.`
81+
let workflowFailMessage = "It looks like you've modified some files that we can't accept as contributions."
82+
83+
try {
84+
createdComment = await github.issues.createComment ({
85+
owner: context.repo.owner,
86+
repo: context.repo.repo,
87+
issue_number: context.payload.number,
88+
body: reviewMessage,
89+
})
90+
91+
workflowFailMessage = `${workflowFailMessage} Please see ${createdComment.data.html_url} for details.`
92+
} catch(err) {
93+
console.log("Error creating comment.", err)
94+
}
95+
96+
core.setFailed(workflowFailMessage)

cache_test/test/test.txt

Whitespace-only changes.

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
[context.deploy-preview]
1111
command = "yarn develop"
12-
##ignore = "./scripts/ignore.sh"
12+
ignore = "./scripts/ignore.sh"
1313

1414
[context.branch-deploy]
1515
command = "yarn develop-inc"

0 commit comments

Comments
 (0)