Skip to content

[TEST 2] Don't run Add to project GH Action in forks #14

[TEST 2] Don't run Add to project GH Action in forks

[TEST 2] Don't run Add to project GH Action in forks #14

---
###########################
###########################
## Pull request testing ##
###########################
###########################
name: Validate pull request
# Documentation:
# - Workflow: https://help.github.com/en/articles/workflow-syntax-for-github-actions
# - SuperLinter: https://github.com/github/super-linter
# - Link validation: https://github.com/remarkjs/remark-validate-links
######################################################
# Start the job on a pull request to the main branch #
######################################################
on: pull_request
#################################################
# Disable all permissions on the workflow level #
#################################################
permissions: {}
###############
# Set the Job #
###############
jobs:
lint:
# Set the agent to run on
runs-on: ubuntu-latest
############################################
# Grant status permission for MULTI_STATUS #
############################################
permissions:
contents: read
statuses: write
##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files
# within `super-linter`
fetch-depth: 0
- name: Load super-linter configuration
run: cat .github/super-linter.env >> "$GITHUB_ENV"
################################
# Run Linters against code base #
################################
- name: Lint Code Base
#
# Use full version number to avoid cases when a next
# released version is buggy
# About slim image: https://github.com/github/super-linter#slim-image
uses: super-linter/super-linter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCH: main
test:
runs-on: ubuntu-latest
needs: lint
permissions:
contents: read
statuses: write
steps:
- uses: actions/checkout@v4
- name: Use Setup Node and Install Dependencies Action
uses: commerce-docs/devsite-install-action@main
with:
node-version-file: '.nvmrc'
cache-dependency-path: 'yarn.lock'
- name: Check links
run: yarn test
build:
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
statuses: write
steps:
- uses: actions/checkout@v4
- name: Use Setup Node and Install Dependencies Action
uses: commerce-docs/devsite-install-action@main
with:
node-version-file: '.nvmrc'
cache-dependency-path: 'yarn.lock'
- name: Build site
run: yarn build