feat: WIP add template gha for code reviews [] #6
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
name: 'App Review Check' | |
on: | |
pull_request: | |
# types: | |
# - opened | |
# - edited | |
# - synchronize | |
# branches: | |
# - 'main' | |
# - 'feat/gha-code-review' | |
permissions: | |
pull-requests: write | |
jobs: | |
main: | |
name: App Review Check | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Checking for app review" | |
- name: Check for new app submission | |
id: check_new_app | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const script = require('./app-review-script.js') | |
await script({github, context, core}) | |
# - name: Check for LICENSE file in PR | |
# id: check_license | |
# run: | | |
# if ! git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^LICENSE$'; then | |
# echo "LICENSE file is missing in the pull request." | |
# exit 1 | |
# fi | |
# echo "LICENSE file exists in the pull request." | |
- name: Add a comment and label to the PR | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const issue_number = context.payload.pull_request.number; | |
const comment_body = 'Thank you for your pull request! We will review it shortly.'; | |
const label_name = 'needs review'; | |
// Add a comment to the PR | |
await github.rest.issues.createComment({ | |
...context.repo, | |
issue_number, | |
body: comment_body, | |
}); | |
// Add a label to the PR | |
await github.rest.issues.addLabels({ | |
...context.repo, | |
issue_number, | |
labels: [label_name], | |
}); |