Skip to content

Commit db293b8

Browse files
committed
Convert test-pull-request workflow to reusable
1 parent b9b9732 commit db293b8

File tree

1 file changed

+5
-93
lines changed

1 file changed

+5
-93
lines changed
+5-93
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,12 @@
11
---
2-
###########################
3-
###########################
4-
## Pull request testing ##
5-
###########################
6-
###########################
72
name: Validate pull request
83

9-
# Documentation:
10-
# - Workflow: https://help.github.com/en/articles/workflow-syntax-for-github-actions
11-
# - SuperLinter: https://github.com/github/super-linter
12-
# - Link validation: https://github.com/remarkjs/remark-validate-links
13-
14-
######################################################
15-
# Start the job on a pull request to the main branch #
16-
######################################################
174
on: pull_request
185

19-
#################################################
20-
# Disable all permissions on the workflow level #
21-
#################################################
22-
permissions: {}
6+
permissions:
7+
contents: read
8+
statuses: write
239

24-
###############
25-
# Set the Job #
26-
###############
2710
jobs:
28-
lint:
29-
# Set the agent to run on
30-
runs-on: ubuntu-latest
31-
32-
############################################
33-
# Grant status permission for MULTI_STATUS #
34-
############################################
35-
permissions:
36-
contents: read
37-
statuses: write
38-
39-
##################
40-
# Load all steps #
41-
##################
42-
steps:
43-
##########################
44-
# Checkout the code base #
45-
##########################
46-
- name: Checkout Code
47-
uses: actions/checkout@v4
48-
with:
49-
# Full git history is needed to get a proper list of changed files
50-
# within `super-linter`
51-
fetch-depth: 0
52-
- name: Load super-linter configuration
53-
run: cat .github/super-linter.env >> "$GITHUB_ENV"
54-
55-
################################
56-
# Run Linters against code base #
57-
################################
58-
- name: Lint Code Base
59-
#
60-
# Use full version number to avoid cases when a next
61-
# released version is buggy
62-
# About slim image: https://github.com/github/super-linter#slim-image
63-
uses: super-linter/super-linter/[email protected]
64-
env:
65-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66-
DEFAULT_BRANCH: main
67-
68-
test:
69-
runs-on: ubuntu-latest
70-
needs: lint
71-
permissions:
72-
contents: read
73-
statuses: write
74-
steps:
75-
- uses: actions/checkout@v4
76-
- name: Use Setup Node and Install Dependencies Action
77-
uses: commerce-docs/devsite-install-action@main
78-
with:
79-
node-version-file: '.nvmrc'
80-
cache-dependency-path: 'yarn.lock'
81-
82-
- name: Check links
83-
run: yarn test
84-
85-
build:
86-
runs-on: ubuntu-latest
87-
needs: test
88-
permissions:
89-
contents: read
90-
statuses: write
91-
steps:
92-
- uses: actions/checkout@v4
93-
- name: Use Setup Node and Install Dependencies Action
94-
uses: commerce-docs/devsite-install-action@main
95-
with:
96-
node-version-file: '.nvmrc'
97-
cache-dependency-path: 'yarn.lock'
98-
99-
- name: Build site
100-
run: yarn build
11+
testing:
12+
uses: AdobeDocs/commerce-php/.github/workflows/validate-pr_job.yml@main

0 commit comments

Comments
 (0)