-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into workflows-for-everyone
- Loading branch information
Showing
16 changed files
with
431 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: 🙋♂️ Ask a question | ||
description: Tell us what's on your mind | ||
title: "[question]: " | ||
labels: ["question"] | ||
# assignees: | ||
# - OneSignal/ios-sdk | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Having issues integrating this SDK? | ||
- type: textarea | ||
id: question | ||
attributes: | ||
label: How can we help? | ||
description: Specific question regarding integrating this SDK. | ||
placeholder: How do I...? | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: terms | ||
attributes: | ||
label: Code of Conduct | ||
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/OneSignal-Flutter-SDK/blob/main/CONTRIBUTING.md) | ||
options: | ||
- label: I agree to follow this project's Code of Conduct | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: 🪳 Bug report | ||
description: File a bug report | ||
title: "[Bug]: " | ||
labels: ["bug", "triage"] | ||
# assignees: | ||
# - OneSignal/ios-sdk | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for taking the time to fill out this bug report! | ||
- type: textarea | ||
id: what-happened | ||
attributes: | ||
label: What happened? | ||
description: Provide a thorough description of whats going on. | ||
placeholder: e.g. The latest version of the SDK causes my screen to go blank when I tap on the screen three times. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: reproduction-steps | ||
attributes: | ||
label: Steps to reproduce? | ||
description: Provide as much detail as posible to reproduce the issue. | ||
placeholder: | | ||
1. Install vX.Y.Z of dependency | ||
2. Launch the app on iOS device | ||
3. Tap the screen three times | ||
4. Note that the app crashes | ||
render: Markdown | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: what-are-expectations | ||
attributes: | ||
label: What did you expect to happen? | ||
description: Also tell us, what did you expect to happen? | ||
placeholder: I expected the app to continue running no matter how many times I tap the screen. | ||
validations: | ||
required: true | ||
- type: input | ||
id: flutter-sdk-version | ||
attributes: | ||
label: OneSignal Flutter SDK version | ||
description: What version of the OneSignal Flutter SDK are you using? | ||
placeholder: Release 3.4.1 | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: platforms | ||
attributes: | ||
label: Which platform(s) are affected? | ||
description: Indicate which mobile platforms this issue is affecting | ||
options: | ||
- label: iOS | ||
required: false | ||
- label: Android | ||
required: false | ||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: Relevant log output | ||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. | ||
render: Shell | ||
- type: checkboxes | ||
id: terms | ||
attributes: | ||
label: Code of Conduct | ||
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/OneSignal-Flutter-SDK/blob/main/CONTRIBUTING.md) | ||
options: | ||
- label: I agree to follow this project's Code of Conduct | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: 📣 General feedback | ||
description: Tell us what's on your mind | ||
title: "[Feedback]: " | ||
labels: ["triage"] | ||
# assignees: | ||
# - OneSignal/ios-sdk | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for sharing your valuable feedback! | ||
- type: textarea | ||
id: feedback | ||
attributes: | ||
label: What's on your mind? | ||
description: Feedback regarding this SDK. | ||
placeholder: Share your feedback... | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: terms | ||
attributes: | ||
label: Code of Conduct | ||
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/OneSignal-Flutter-SDK/blob/main/CONTRIBUTING.md) | ||
options: | ||
- label: I agree to follow this project's Code of Conduct | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Based on probot-metadata - https://github.com/probot/metadata | ||
*/ | ||
const regex = /\n\n<!-- probot = (.*) -->/ | ||
|
||
const { Octokit } = require("@octokit/action") | ||
|
||
const octokit = new Octokit() | ||
|
||
module.exports = (context, issue = null) => { | ||
console.log(context) | ||
const prefix = "onesignal-probot" | ||
|
||
if (!issue) issue = context.payload.issue | ||
|
||
return { | ||
async get (key = null) { | ||
let body = issue.body | ||
|
||
if (!body) { | ||
body = (await octokit.issues.get(issue)).data.body || '' | ||
} | ||
|
||
const match = body.match(regex) | ||
|
||
if (match) { | ||
const data = JSON.parse(match[1])[prefix] | ||
return key ? data && data[key] : data | ||
} | ||
}, | ||
|
||
async set (key, value) { | ||
let body = issue.body | ||
let data = {} | ||
|
||
if (!body) body = (await octokit.issues.get(issue)).data.body || '' | ||
|
||
body = body.replace(regex, (_, json) => { | ||
data = JSON.parse(json) | ||
return '' | ||
}) | ||
|
||
if (!data[prefix]) data[prefix] = {} | ||
|
||
if (typeof key === 'object') { | ||
Object.assign(data[prefix], key) | ||
} else { | ||
data[prefix][key] = value | ||
} | ||
|
||
body = `${body}\n\n<!-- probot = ${JSON.stringify(data)} -->` | ||
|
||
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/") | ||
const issue_number = context.payload.issue.number | ||
return octokit.issues.update({ owner, repo, issue_number, body }) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name-template: $RESOLVED_VERSION | ||
tag-template: $RESOLVED_VERSION | ||
categories: | ||
- title: 🚀 Features | ||
label: Enhancement / Feature | ||
- title: 🐛 Bug Fixes | ||
label: Bug | ||
- title: 🧰 Improvements | ||
label: Improvement | ||
- title: down arrow Dependency Updates | ||
label: Dependencies | ||
change-template: '- $TITLE (#$NUMBER)' | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
## Other Changes | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
function calcResponseTimeForIssueCreatedAt(createdAt) { | ||
const issueOpenedDate = new Date(createdAt); | ||
const issueTriagedDate = new Date(); | ||
const businessDaysResponseTime = calcBusinessDaysBetweenDates(issueOpenedDate, issueTriagedDate); | ||
return businessDaysResponseTime; | ||
} | ||
|
||
function calcBusinessDaysBetweenDates(openedDate, triagedDate) { | ||
let differenceInWeeks, responseTime; | ||
if (triagedDate < openedDate) | ||
return -1; // error code if dates transposed | ||
let openedDay = openedDate.getDay(); // day of week | ||
let triagedDay = triagedDate.getDay(); | ||
openedDay = (openedDay == 0) ? 7 : openedDay; // change Sunday from 0 to 7 | ||
triagedDay = (triagedDay == 0) ? 7 : triagedDay; | ||
openedDay = (openedDay > 5) ? 5 : openedDay; // only count weekdays | ||
triagedDay = (triagedDay > 5) ? 5 : triagedDay; | ||
// calculate differnece in weeks (1000mS * 60sec * 60min * 24hrs * 7 days = 604800000) | ||
differenceInWeeks = Math.floor((triagedDate.getTime() - openedDate.getTime()) / 604800000); | ||
if (openedDay < triagedDay) { //Equal to makes it reduce 5 days | ||
responseTime = (differenceInWeeks * 5) + (triagedDay - openedDay); | ||
} | ||
else if (openedDay == triagedDay) { | ||
responseTime = differenceInWeeks * 5; | ||
} | ||
else { | ||
responseTime = ((differenceInWeeks + 1) * 5) - (openedDay - triagedDay); | ||
} | ||
return (responseTime); | ||
} | ||
|
||
module.exports = async(context, osmetadata) => { | ||
const foundResponseTime = await osmetadata(context).get('response_time_in_business_days'); | ||
if (foundResponseTime) { | ||
const foundString = "already found response time in business days: " + foundResponseTime | ||
console.log(foundString); | ||
return foundString; | ||
} | ||
if (context.payload.comment && context.payload.comment.author_association != "MEMBER" && context.payload.comment.author_association != "OWNER" && context.payload.comment.author_association != "CONTRIBUTOR") { | ||
return; | ||
} | ||
const businessDaysResponseTime = calcResponseTimeForIssueCreatedAt(context.payload.issue.created_at); | ||
console.log("response time in business days: " + businessDaysResponseTime); | ||
const result = osmetadata(context, context.payload.issue).set('response_time_in_business_days', businessDaysResponseTime) | ||
console.log("osmetadata update result: " + result); | ||
return "set response time in business days: " + businessDaysResponseTime; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This is an action to close asana tasks that were generated by Github issues | ||
|
||
name: Zapier web hook | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
issues: | ||
types: [closed] | ||
|
||
permissions: | ||
issues: read | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Runs a set of commands using the runners shell | ||
- name: Call Zapier web hook to close Asana task | ||
if: ${{ !github.event.issue.pull_request }} | ||
env: | ||
ISSUE_TITLE: ${{ github.event.issue.title }} | ||
run: | | ||
curl --location --request POST 'https://hooks.zapier.com/hooks/catch/12728683/b7009qc/' \ | ||
--header 'Content-Type: application/json' \ | ||
--header 'Accept: application/json' \ | ||
--data-raw '{ | ||
"task_name" : "$ISSUE_TITLE" | ||
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
# branches to consider in the event; optional, defaults to all | ||
branches: | ||
- main | ||
# pull_request event is required only for autolabeler | ||
pull_request: | ||
# Only following types are handled by the action, but one can default to all as well | ||
types: [opened, reopened, synchronize] | ||
# pull_request_target event is required for autolabeler to support PRs from forks | ||
# pull_request_target: | ||
# types: [opened, reopened, synchronize] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
update_release_draft: | ||
permissions: | ||
# write permission is required to create a github release | ||
contents: write | ||
# write permission is required for autolabeler | ||
# otherwise, read permission is required at least | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
# (Optional) GitHub Enterprise requires GHE_HOST variable set | ||
#- name: Set GHE_HOST | ||
# run: | | ||
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV | ||
|
||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml | ||
# with: | ||
# config-name: my-config.yml | ||
# disable-autolabeler: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Set Response Time | ||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
issues: | ||
types: | ||
- closed | ||
jobs: | ||
calculate: | ||
name: set reponse time for the issue | ||
if: github.event.issue.pull_request == null | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: npm install @octokit/action | ||
- uses: actions/github-script@v6 | ||
id: set-time | ||
with: | ||
result-encoding: string | ||
script: | | ||
const os_probot_metadata = require('./.github/os_probot_metadata.js') | ||
const set_response_time = require('./.github/set_response_times.js') | ||
return await set_response_time(context, os_probot_metadata) | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Get result | ||
run: echo "${{steps.set-time.outputs.result}}" >> $GITHUB_STEP_SUMMARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.