Insert link to Release Note #3991
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: Run Spectral on Pull Requests | |
on: pull_request | |
jobs: | |
build: | |
name: Run Spectral | |
runs-on: ubuntu-latest | |
steps: | |
# Check out the repository | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Add comment to PR | |
- name: Comment a pull_request | |
uses: mshick/add-pr-comment@v2 | |
with: | |
message: "Thanks for your contribution. The .json file will be checked now with Spectral." | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
# Get the name of changed files | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/[email protected] | |
with: | |
files: | | |
*.json | |
# Print the names of changed files | |
- name: Print changed files | |
run: | | |
echo "Changed files: ${{ steps.changed-files.outputs.modified_files }}" | |
# Run Spectral on changed files | |
- uses: stoplightio/[email protected] | |
with: | |
file_glob: ${{ steps.changed-files.outputs.modified_files }} |