Skip to content

Commit

Permalink
GH Templates and codeowner (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Nov 2, 2023
1 parent bc6fd32 commit 94b1e16
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @marandaneto
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 🐞 Bug Report
description: Tell us about something that's not working the way we (probably) intend.
labels: ["Platform: iOS", "bug"]
body:


- type: input
id: version
attributes:
label: Version
description: SDK Version
placeholder: 3.0.0 ← should look like this
validations:
required: true

- type: textarea
id: repro
attributes:
label: Steps to Reproduce
description: How can we see what you're seeing? Specific is terrific.
placeholder: |-
1. foo
2. bar
3. baz
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Result
validations:
required: true

- type: textarea
id: actual
attributes:
label: Actual Result
description: Logs? Screenshots? Yes, please.
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask in the forums
url: https://posthog.com/questions
about: A place to ask questions.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 💡 Feature Request
description: Tell us about a problem our SDK could solve but doesn't.
labels: ["enhancement"]
body:
- type: textarea
id: problem
attributes:
label: Problem Statement
description: What problem could we solve that it doesn't?
placeholder: |-
I want to make whirled peas, but it doesn't blend.
validations:
required: true

- type: textarea
id: expected
attributes:
label: Solution Brainstorm
description: We know you have bright ideas to share ... share away, friend.
placeholder: |-
Add a blender to it.
validations:
required: false
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/maintainer-blank.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Blank Issue
description: Blank Issue. Reserved for maintainers.
body:
- type: textarea
id: description
attributes:
label: Description
description: Please describe the issue.
validations:
required: true
21 changes: 10 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
**What does this PR do?**
## :bulb: Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

**Where should the reviewer start?**

**How should this be manually tested?**
## :green_heart: How did you test it?

**Any background context you want to provide?**

**What are the relevant tickets?**
## :pencil: Checklist
<!--- Put an `x` in the boxes that apply -->

**Screenshots or screencasts (if UI/UX change)**

**Questions:**
- Does the docs need an update?
- Are there any security concerns?
- Do we need to update engineering / success?
- [ ] I reviewed the submitted code.
- [ ] I added tests to verify the changes.
- [ ] I updated the docs if needed.
- [ ] No breaking change or entry added to the changelog.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
2 changes: 2 additions & 0 deletions .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- main
- v3.0.0
pull_request:
paths-ignore:
- "**/*.md"
jobs:
build:
runs-on: macos-13
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- main
- v3.0.0
pull_request:
paths-ignore:
- "**/*.md"
jobs:
build:
runs-on: macos-13
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Danger"
on:
pull_request:
types: [opened, synchronize, reopened, edited, ready_for_review]

jobs:
build:
name: Changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: npx danger ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- main
- v3.0.0
pull_request:
paths-ignore:
- "**/*.md"
jobs:
lint:
runs-on: macos-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- main
- v3.0.0
pull_request:
paths-ignore:
- "**/*.md"
jobs:
test:
runs-on: macos-13
Expand Down
60 changes: 60 additions & 0 deletions dangerfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
async function checkChangelog() {
const changelogFile = "CHANGELOG.md";

// Check if skipped
const skipChangelog =
danger.github && (danger.github.pr.body + "").includes("#skip-changelog");

if (skipChangelog) {
return;
}

// Check if current PR has an entry in changelog
const changelogContents = await danger.github.utils.fileContents(
changelogFile
);

const hasChangelogEntry = RegExp(`#${danger.github.pr.number}\\b`).test(
changelogContents
);

if (hasChangelogEntry) {
return;
}

// Report missing changelog entry
fail(
"Please consider adding a changelog entry for the next release.",
changelogFile
);

const prTitleFormatted = danger.github.pr.title
.split(": ")
.slice(-1)[0]
.trim()
.replace(/\.+$/, "");

markdown(
`
### Instructions and example for changelog
Please add an entry to \`CHANGELOG.md\` to the "Next" section. Make sure the entry includes this PR's number.
Example:
\`\`\`markdown
## Next
- ${prTitleFormatted} ([#${danger.github.pr.number}](${danger.github.pr.html_url}))
\`\`\`
If none of the above apply, you can opt out of this check by adding \`#skip-changelog\` to the PR description.`.trim()
);
}

async function checkAll() {
const isDraft = danger.github.pr.mergeable_state === "draft";

if (isDraft) {
return;
}

await checkChangelog();
}

schedule(checkAll);

0 comments on commit 94b1e16

Please sign in to comment.