EDU-14497: Update create-a-regular-order-from-an-existing-cart.md #652
Workflow file for this run
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: Check VTEX Styleguide | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
check-vtex-styleguide: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Step 2: Set up Node.js | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: npm install @actions/core@1.10 | |
- name: Install Reviewdog | |
uses: reviewdog/action-setup@v1 | |
# Step 4: Get all changed markdown files | |
- name: Get all changed markdown files | |
id: changed-markdown-files | |
uses: tj-actions/changed-files@v45 | |
with: | |
files: | | |
**.md | |
**.mdx | |
# Step 5: Run style checker and collect issues | |
- name: Run style checker | |
id: style-check | |
if: steps.changed-markdown-files.outputs.any_changed == 'true' | |
run: | | |
> style_issues.txt | |
for file in ${{ steps.changed-markdown-files.outputs.all_changed_files }}; do | |
echo "Running styleguide checker on $file" | |
node .github/scripts/check-styleguide.js "./$file" >> style_issues.txt || true | |
done | |
if [ -s style_issues.txt ]; then | |
echo "style-issues=true" >> $GITHUB_ENV | |
fi | |
# Step 6: Run Reviewdog | |
- name: Run Reviewdog | |
if: env.style-issues == 'true' | |
run: | | |
echo "Running Reviewdog with the following style issues:" | |
cat style_issues.txt | |
reviewdog -efm="%f:%l:%c:%m" -name="style-check" -reporter=github-pr-review < style_issues.txt | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Step 7: Fail the PR if there are style issues | |
- name: Fail PR if style issues | |
if: env.style-issues == 'true' | |
run: exit 1 |