-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
42 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,42 @@ | ||
name: Snapshot comment | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'polaris-react/**' | ||
types: | ||
- ready_for_review | ||
|
||
jobs: | ||
check: | ||
if: | | ||
!contains(github.event.pull_request.labels.*.name, '🤖Skip Snapshot') || | ||
!containers(github.event.comment.body, 'Your snapshots have been published to npm.') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node with v18.12.0 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.12.0 | ||
|
||
- name: Check if author is part of `polaris-team` org | ||
uses: tspascoal/get-user-teams-membership@v2 | ||
id: checkUserMember | ||
with: | ||
username: ${{ github.actor }} | ||
team: 'polaris-team' | ||
GITHUB_TOKEN: ${{ secrets.GH_CHECKING_USER_AUTH }} | ||
|
||
- name: Add comment for snapshot testing | ||
if: ${{ steps.checkUserMember.outputs.isTeamMember == 'false' }} | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
issue-number: 1 | ||
body: | | ||
Thank you for contributing to a change to Polaris! 🚀 | ||
Please ensure you test your changes with a snapshot by commenting `/snapit` on your PR. |