forked from hannibal002/SkyHanni
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
402 changed files
with
6,428 additions
and
2,920 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,64 @@ | ||
name: "Assign relevant labels" | ||
on: | ||
pull_request_target: | ||
types: [ opened, edited ] | ||
jobs: | ||
assign-label: | ||
if: github.event.pull_request.state == 'open' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
contents: read | ||
steps: | ||
- name: label | ||
env: | ||
TITLE: ${{ github.event.pull_request.title }} | ||
LABEL_FIX: Bug Fix | ||
LABEL_BACKEND: Backend | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN}} | ||
script: | | ||
const labelsToAdd = []; | ||
const labelsToRemove = []; | ||
const title = process.env.TITLE.split(":")[0].toUpperCase(); | ||
if(title.includes("FIX")){ | ||
labelsToAdd.push(process.env.LABEL_FIX); | ||
} else { | ||
labelsToRemove.push(process.env.LABEL_FIX); | ||
} | ||
if(title.includes("BACKEND")){ | ||
labelsToAdd.push(process.env.LABEL_BACKEND); | ||
} else { | ||
labelsToRemove.push(process.env.LABEL_BACKEND); | ||
} | ||
for (const label of labelsToAdd) { | ||
github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: [label] | ||
}); | ||
} | ||
const {data} = await github.rest.issues.listLabelsOnIssue({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}); | ||
for (const label of labelsToRemove) { | ||
const filtered = data.filter(l => l.name == label); | ||
if(filtered.length == 1){ | ||
github.rest.issues.removeLabel({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
name: label | ||
}); | ||
} | ||
} |
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
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,57 @@ | ||
name: "PR Changelog Verification" | ||
|
||
on: | ||
pull_request_target: | ||
types: [ opened, edited ] | ||
|
||
jobs: | ||
verify-changelog: | ||
if: github.event.pull_request.state == 'open' && '511310721' == github.repository_id | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-normal-workspace | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Run ChangeLog verification | ||
env: | ||
PR_TITLE: ${{ github.event.pull_request.title }} | ||
PR_BODY: ${{ github.event.pull_request.body }} | ||
run: | | ||
./gradlew checkPrDescription -PprTitle="${PR_TITLE}" -PprBody="${PR_BODY}" | ||
- name: Add label if changelog verification fails | ||
if: failure() | ||
uses: actions-ecosystem/action-add-labels@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
labels: 'Wrong Title/Changelog' | ||
|
||
- name: Remove label if changelog verification passes | ||
if: success() | ||
uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
labels: 'Wrong Title/Changelog' | ||
|
||
- name: Add comment to PR if changelog verification fails | ||
if: failure() | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const fs = require('fs'); | ||
const test = fs.readFileSync('versions/1.8.9/build/changelog_errors.txt', 'utf8'); | ||
const commentBody = `${test}` | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: commentBody | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
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,17 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven("https://jitpack.io") { | ||
content { | ||
includeGroupByRegex("com\\.github\\..*") | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib") | ||
implementation("com.github.SkyHanniStudios:SkyHanniChangelogBuilder:1.0.1") | ||
} |
Oops, something went wrong.