mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
77 lines
2.4 KiB
YAML
77 lines
2.4 KiB
YAML
# This workflow validates basic pull request formatting requirements are met.
|
|
#
|
|
# Copyright (c) Microsoft Corporation.
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
#
|
|
|
|
name: Validate Pull Request Formatting
|
|
|
|
on:
|
|
pull_request_target:
|
|
branches:
|
|
- master
|
|
types:
|
|
- edited
|
|
- opened
|
|
- reopened
|
|
- synchronize
|
|
|
|
concurrency:
|
|
group: pr-validation-${{ github.event.number }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
validate_pr:
|
|
name: Validate Pull Request Formatting
|
|
# Do not run on draft PRs and only run on PRs in the tianocore org
|
|
if: ${{ github.event.pull_request.draft == false && github.repository_owner == 'tianocore' }}
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Generate Token
|
|
id: app-token
|
|
uses: actions/create-github-app-token@v3
|
|
with:
|
|
app-id: ${{ secrets.TIANOCORE_PR_AUTOMATION_APPLICATION_ID }}
|
|
private-key: ${{ secrets.TIANOCORE_PR_AUTOMATION_APPLICATION_PRIVATE_KEY }}
|
|
|
|
# Reduce checkout time with sparse-checkout
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 1
|
|
sparse-checkout: |
|
|
.github/scripts/
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.x'
|
|
cache: 'pip'
|
|
cache-dependency-path: '.github/scripts/requirements.txt'
|
|
|
|
- name: Install PIP Modules
|
|
run: pip install -r .github/scripts/requirements.txt
|
|
|
|
- name: Validate PR Format
|
|
id: validate
|
|
run: python .github/scripts/validate_pr_formatting.py
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
OWNER: ${{ github.repository_owner }}
|
|
PR_NUMBER: ${{ github.event.number }}
|
|
REPO: ${{ github.event.pull_request.base.repo.name }}
|
|
|
|
- name: Post Validation Comment
|
|
if: steps.validate.outputs.validation_error == 'true'
|
|
run: python .github/scripts/validate_pr_formatting.py --post-comment
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
PR_NUMBER: ${{ github.event.number }}
|
|
|
|
- name: Check for Validation Errors
|
|
if: steps.validate.outputs.validation_error == 'true'
|
|
uses: actions/github-script@v9
|
|
with:
|
|
script: |
|
|
core.setFailed('PR Formatting Validation Check Failed!')
|