-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.x] Remove StyleCI and update GH workflows (#31)
* replace StyleCI with Laravel Pint * Update github workflows * Dont install Pint on unsupported version of PHP
- Loading branch information
1 parent
fb7e312
commit 25bc375
Showing
13 changed files
with
319 additions
and
19 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,70 @@ | ||
name: Bug report | ||
description: Report a problem you're experiencing | ||
labels: bug,unconfirmed,low priority | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Before opening a bug report, please search the existing issues (both open and closed). | ||
--- | ||
Thank you for taking the time to file a bug report. To address this bug as fast as possible, we need some information. | ||
- type: input | ||
id: package-version | ||
attributes: | ||
label: Package Version | ||
description: Please provide the full version of the package you have installed. | ||
placeholder: v1.0.0 | ||
validations: | ||
required: true | ||
- type: input | ||
id: laravel-version | ||
attributes: | ||
label: Laravel Version | ||
description: Please provide the full Laravel version of your project. | ||
placeholder: v10.0.0 | ||
validations: | ||
required: true | ||
- type: input | ||
id: php-version | ||
attributes: | ||
label: PHP Version | ||
description: Please provide the full PHP version of your server. | ||
placeholder: PHP 8.3.0 | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Problem description | ||
description: What happened when you experienced the problem? | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: expectation | ||
attributes: | ||
label: Expected behavior | ||
description: What did you expect to happen instead? | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: steps | ||
attributes: | ||
label: Steps to reproduce | ||
description: Which steps do we need to take to reproduce the problem? Any code examples need to be **as short as possible**, remove any code that is unrelated to the bug. **This issue will be automatically closed and not reviewed if detailed replication steps are missing.** | ||
validations: | ||
required: true | ||
- type: input | ||
id: reproduction | ||
attributes: | ||
label: Reproduction repository | ||
description: The URL of a public GitHub repository which reproduces the problem. **Please do not link to your actual project**, what we need instead is a _minimal_ reproduction in a fresh project without any unnecessary code. This means it doesn\'t matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. This allows us to fix the problem much quicker. **This issue will be automatically closed and not reviewed if this is missing. Please make sure to format the URL starting with `https://github.com` - only repositories hosted on GitHub are accepted.** | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: Relevant log output | ||
description: If applicable, provide relevant log output. No need for backticks here. | ||
render: shell |
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,8 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Feature request | ||
url: https://github.com/joelbutcher/laravel-facebook-graph/issues/new | ||
about: Share ideas for new features | ||
- name: Support question | ||
url: https://github.com/joelbutcher/laravel-facebook-graph/issues/new | ||
about: Ask the community for help |
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,13 @@ | ||
name: "Fix Code Styling" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
lint: | ||
uses: laravel/.github/.github/workflows/coding-standards.yml@main |
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,196 @@ | ||
name: manage-issue | ||
|
||
on: | ||
issues: | ||
types: [opened, edited] | ||
|
||
jobs: | ||
check-repro: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
const URL_REGEXP = /### Reproduction repository[\r\n]+([^#]+)###/m | ||
const REPRO_STEPS_REGEXP = /### Steps to reproduce[\r\n]+([^#]+)###/m | ||
const LABEL_NEEDS_MORE_INFORMATION = 'needs more info' | ||
function debug(...args) { | ||
core.info(args.map(JSON.stringify).join(' ')) | ||
} | ||
if (context.payload.comment) { | ||
debug('Ignoring comment update.') | ||
return | ||
} | ||
const user = context.payload.sender.login | ||
const issue = context.payload.issue | ||
const body = issue.body | ||
const urlMatch = body.match(URL_REGEXP) | ||
const reproStepsMatch = body.match(REPRO_STEPS_REGEXP) | ||
const url = urlMatch !== null ? urlMatch[1].trim() : null | ||
const reproSteps = reproStepsMatch !== null ? reproStepsMatch[1].trim() : null | ||
debug(`Found URL '${url}'`) | ||
debug(`Found repro steps '${reproSteps}'`) | ||
async function createComment(comment) { | ||
comment = comment | ||
.split('\n') | ||
.map((line) => line.trim()) | ||
.join('\n') | ||
.trim() | ||
await github.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: comment, | ||
}) | ||
} | ||
async function getGitHubActionComments() { | ||
debug(`Loading existing comments...`) | ||
const comments = await github.issues.listComments({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}) | ||
return comments.data.filter(comment => { | ||
debug(`comment by user: '${comment.user.login}'`) | ||
return comment.user.login === 'github-actions[bot]' | ||
}) | ||
} | ||
async function getIssueLabels() { | ||
const issues = await github.issues.listLabelsOnIssue({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}) | ||
return issues.data | ||
} | ||
async function updateIssue(state, state_reason = null) { | ||
await github.issues.update({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
state, | ||
state_reason, | ||
}) | ||
} | ||
async function closeWithComment(comment) { | ||
if (issue.state !== 'open') { | ||
debug(`Issue is not open`) | ||
return | ||
} | ||
const comments = await getGitHubActionComments() | ||
if (comments.length > 0) { | ||
debug(`Already commented on issue won't comment again`) | ||
return | ||
} | ||
debug(`Missing required information`) | ||
await github.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: [LABEL_NEEDS_MORE_INFORMATION], | ||
}) | ||
await createComment(comment) | ||
await updateIssue('closed', 'not_planned') | ||
} | ||
async function openWithComment(comment) { | ||
if (issue.state !== 'closed') { | ||
debug(`Issue is already open`) | ||
return | ||
} | ||
const labels = await getIssueLabels() | ||
const label = labels.find(label => label.name === LABEL_NEEDS_MORE_INFORMATION) | ||
if (! label) { | ||
debug(`Issue was not tagged as needs information`) | ||
return | ||
} | ||
const comments = await getGitHubActionComments() | ||
if (comments.length === 0) { | ||
debug(`Issue was closed by someone else, won't reopen`) | ||
return | ||
} | ||
debug(`Reopening closed issue`) | ||
await github.issues.removeLabel({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
name: LABEL_NEEDS_MORE_INFORMATION, | ||
}) | ||
await createComment(comment) | ||
await updateIssue('open') | ||
} | ||
const COMMENT_HEADER = ` | ||
Hey @${user}! We're sorry to hear that you've hit this issue. 💙 | ||
`.trim() | ||
const NO_REPRO_URL = ((! url) || (! url.includes('https://github.com/')) || (url.includes('https://github.com/joelbutcher') && (! url.includes('https://github.com/joelbutcher/laravel-facebook-graph-demo')))) | ||
const NO_REPRO_STEPS = reproSteps.length < 25 | ||
if (NO_REPRO_URL || NO_REPRO_STEPS) { | ||
let comment = ` | ||
${COMMENT_HEADER} | ||
` | ||
if (NO_REPRO_URL) { | ||
comment += ` | ||
However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue? | ||
We need a public GitHub repository which contains a Laravel app with the minimal amount of Socialstream code to reproduce the problem. **Please do not link to your actual project**, what we need instead is a _minimal_ reproduction in a fresh project without any unnecessary code. This means it doesn\'t matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly. | ||
` | ||
} | ||
if (NO_REPRO_URL && NO_REPRO_STEPS) { | ||
comment += ` | ||
Also, ` | ||
} else if (NO_REPRO_STEPS) { | ||
comment += ` | ||
However, ` | ||
} | ||
if (NO_REPRO_STEPS) { | ||
comment += `it doesn't look like you've provided much information on how to replicate the issue. Please edit your original post with clear steps we need to take.` | ||
} | ||
closeWithComment(comment) | ||
} else { | ||
openWithComment(` | ||
Thank you for providing reproduction steps! Reopening the issue now. | ||
`) | ||
} |
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
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,9 @@ | ||
name: update changelog | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
update: | ||
uses: laravel/.github/.github/workflows/update-changelog.yml@main |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
# Release Notes |
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
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,3 @@ | ||
{ | ||
"preset": "per" | ||
} |
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.