-
Notifications
You must be signed in to change notification settings - Fork 3
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
3 changed files
with
69 additions
and
0 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,26 @@ | ||
name: Run Format | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
prettier: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "18" # Updated Node.js version | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run script | ||
run: npm run format:check # Replace with the path to your script |
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,39 @@ | ||
name: Greet New PRs and Issues | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
issues: | ||
types: [opened] | ||
|
||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
greet: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Greet on PRs and Issues | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
try { | ||
const isPR = context.payload.pull_request !== undefined; | ||
const number = isPR ? context.payload.pull_request.number : context.payload.issue.number; | ||
const commentBody = isPR | ||
? `Hey there! 👋 Thanks for taking the time to send in this pull request. We are happy to have your contribution! If you have any questions or need any help, feel free to ask.` | ||
: `Hello! 👋 Thanks for opening this issue. We appreciate your feedback and will look into it as soon as possible. Feel free to add more details if necessary.`; | ||
await github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: number, | ||
body: commentBody | ||
}); | ||
console.log('Comment successfully created.'); | ||
} catch (error) { | ||
console.error('Error creating comment:', error); | ||
// Do not mark the step as failed; continue with the workflow. | ||
} |
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,4 @@ | ||
module.exports = { | ||
tabWidth: 2, | ||
useTabs: false, | ||
}; |