-
Notifications
You must be signed in to change notification settings - Fork 31
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
1 changed file
with
43 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,43 @@ | ||
name: PR Workflow | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'develop' # master | ||
|
||
jobs: | ||
checkRef: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Check if "rc" is present in github.ref | ||
id: check_ref | ||
run: | | ||
echo ${{ github.head_ref || github.ref_name }} | ||
if [[ "${{ github.head_ref || github.ref_name }}" == *"/rc/"* ]]; then | ||
echo "ref_contains_rc=1" >> $GITHUB_OUTPUT | ||
else | ||
echo "ref_contains_rc=0" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Output check result | ||
run: | | ||
echo "Output: ${{ steps.check_ref.outputs.ref_contains_rc }}" | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check if comment contains "Release notes" | ||
if: github.ref == 'refs/heads/master' | ||
uses: actions/github-script@v4 | ||
with: | ||
script: | | ||
const comment = github.event.pull_request.comments.find(c => c.body.includes('Release notes')); | ||
if (!comment) { | ||
console.log('No comment found with "Release notes"'); | ||
throw new Error('Missing release notes'); | ||
} else { | ||
console.log('Comment found with "Release notes"'); | ||
} |