generated from antfu-collective/vitesse
-
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.
- Loading branch information
1 parent
a431f5a
commit 536f780
Showing
1 changed file
with
44 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,44 @@ | ||
name: Comment on PR | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
comment_on_pr: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Check if PR targets main | ||
run: echo "Is Main Branch: ${{ github.event.pull_request.base.ref == 'main' }}" | ||
|
||
- name: Check for changes in ofertas.ts | ||
id: check_changes | ||
run: | | ||
if git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} | grep -q "ofertas.ts"; then | ||
echo "Changes found in ofertas.ts" | ||
echo "::set-output name=changes::true" | ||
else | ||
echo "No changes in ofertas.ts" | ||
echo "::set-output name=changes::false" | ||
fi | ||
- name: Comment on PR if there are changes in ofertas.ts | ||
if: steps.check_changes.outputs.changes == 'true' | ||
uses: actions/github-script@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const message = `Hey there! It looks like there are new changes in 'ofertas.ts'. Please review the updates. Thank you!`; | ||
github.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: message, | ||
}); |