Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ body:
description: |
examples:
- **OS**: Ubuntu 20.04 or Windows 11...
- **Tool Chain**: GCC5 or VS2022 or CLANGPDB...
- **Tool Chain**: GCC or VS2022 or CLANGPDB...
- **Targets Impacted**: RELEASE, DEBUG, NO-TARGET, NOOPT...
value: |
- OS(s):
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
jobs:
apply:

uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@131433bb4f29d68250154cc66096f04c19fe3ee9 # v18.0.7
uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@9720bedf20a0e78a93b79f9d43a7bbfc2be38a62 # v18.0.10
secrets: inherit

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
2 changes: 1 addition & 1 deletion .github/workflows/label-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
jobs:
sync:

uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@131433bb4f29d68250154cc66096f04c19fe3ee9 # v18.0.7
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@9720bedf20a0e78a93b79f9d43a7bbfc2be38a62 # v18.0.10
secrets: inherit

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
42 changes: 42 additions & 0 deletions .github/workflows/pull-request-formatting-validator-post.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow posts pull request formatting comments after the "Validate Pull Request Formatting"
# workflow completes. It runs from the default branch with access to secrets, which the pull_request
# workflow does not have.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
# NOTE: This file uses a reusable workflow. Do not make changes to the file that should be made
# in the common/reusable workflow.
#
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

name: Validate Pull Request Formatting Post

on:
workflow_run:
workflows: ["Validate Pull Request Formatting"]
types: ["completed"]

permissions:
contents: read
actions: read

jobs:
post_comments:
# The metadata artifact is only uploaded when the title check fails.
if: |
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'failure'
uses: microsoft/mu_devops/.github/workflows/PullRequestFormattingValidatorPost.yml@9720bedf20a0e78a93b79f9d43a7bbfc2be38a62 # v18.0.10
with:
app-id: ${{ vars.MU_ACCESS_APP_ID }}
head-sha: ${{ github.event.workflow_run.head_sha }}
triggering-run-id: ${{ github.event.workflow_run.id }}
secrets:
private-key: ${{ secrets.MU_ACCESS_APP_PRIVATE_KEY }}

82 changes: 42 additions & 40 deletions .github/workflows/pull-request-formatting-validator.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# This workflow validates basic pull request formatting requirements are met.
#
# The title check runs without secrets. When it fails, the pull request number is uploaded so the
# "Validate Pull Request Formatting Post" workflow can post a comment.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
Expand All @@ -13,62 +16,61 @@
name: Validate Pull Request Formatting

on:
pull_request_target:
pull_request:
types:
- edited
- opened
- reopened
- synchronize

permissions:
contents: read

jobs:
validate_pr:
runs-on: ubuntu-latest

steps:
- name: Generate Token
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
with:
app-id: ${{ vars.MU_ACCESS_APP_ID }}
private-key: ${{ secrets.MU_ACCESS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- run: |
prTitle="$(gh api graphql -F owner=$OWNER -F name=$REPO -F pr_number=$PR_NUMBER -f query='
query($name: String!, $owner: String!, $pr_number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $pr_number) {
title
}
}
}' --jq '.data.repository.pullRequest.title')"
- name: Validate Pull Request Title
id: validate
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
personal_prefix=false
default_sync_title=false

comments="$(gh api "repos/${OWNER}/${REPO}/issues/${PR_NUMBER}/comments" --paginate --jq '.[].body')"
if [[ "${PR_TITLE,,}" == *"personal/"* ]]; then
echo "::error::Please add a meaningful PR title (remove the 'Personal/' prefix from the title)."
personal_prefix=true
fi

if [[ "${prTitle}" == *"Personal/"* ]]; then
if ! echo "${comments}" | grep -qF '<!-- pr-val-personal -->'; then
gh pr comment $PR_URL --body "<!-- pr-val-personal -->⚠️ Please add a meaningful PR title (remove the 'Personal/' prefix from the title)."
fi
echo 'VALIDATION_ERROR=true' >> $GITHUB_ENV
if [[ "${PR_TITLE}" == "Repo File Sync: synced file(s) with microsoft/mu_devops" ]]; then
echo "::error::Please add a meaningful PR title (update the default file sync title)."
default_sync_title=true
fi

if [[ "${prTitle}" == "Repo File Sync: synced file(s) with microsoft/mu_devops" ]]; then
if ! echo "${comments}" | grep -qF '<!-- pr-val-sync-title -->'; then
gh pr comment $PR_URL --body "<!-- pr-val-sync-title -->⚠️ Please add a meaningful PR title (update the default file sync title)."
fi
echo 'VALIDATION_ERROR=true' >> $GITHUB_ENV
violation=false
if [[ "${personal_prefix}" == "true" || "${default_sync_title}" == "true" ]]; then
violation=true
mkdir metadata
printf '{"pr_number": %s, "personal_prefix": %s, "default_sync_title": %s}\n' \
"${PR_NUMBER}" "${personal_prefix}" "${default_sync_title}" > metadata/pr-metadata.json
fi

env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
OWNER: ${{ github.repository_owner }}
PR_NUMBER: ${{ github.event.number }}
PR_URL: ${{ github.event.pull_request.html_url }}
REPO: ${{ github.event.repository.name }}
echo "violation=${violation}" >> "$GITHUB_OUTPUT"

- name: Check for Validation Errors
if: env.VALIDATION_ERROR
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
- name: Upload PR Metadata
if: steps.validate.outputs.violation == 'true'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
script: |
core.setFailed('PR Formatting Validation Check Failed!')
name: pr-formatting-metadata
path: metadata/pr-metadata.json
overwrite: true
retention-days: 5

- name: Check for Validation Errors
if: steps.validate.outputs.violation == 'true'
run: |
echo "::error::PR Formatting Validation Check Failed!"
exit 1
2 changes: 1 addition & 1 deletion .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
draft:
name: Draft Releases

uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@131433bb4f29d68250154cc66096f04c19fe3ee9 # v18.0.7
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@9720bedf20a0e78a93b79f9d43a7bbfc2be38a62 # v18.0.10
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
jobs:
check:

uses: microsoft/mu_devops/.github/workflows/Stale.yml@131433bb4f29d68250154cc66096f04c19fe3ee9 # v18.0.7
uses: microsoft/mu_devops/.github/workflows/Stale.yml@9720bedf20a0e78a93b79f9d43a7bbfc2be38a62 # v18.0.10
secrets: inherit

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
2 changes: 1 addition & 1 deletion .github/workflows/triage-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
jobs:
triage:

uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@131433bb4f29d68250154cc66096f04c19fe3ee9 # v18.0.7
uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@9720bedf20a0e78a93b79f9d43a7bbfc2be38a62 # v18.0.10
secrets: inherit

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Loading