Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-517: Display warning to merge target branch in GitHub Action Job Summary #263

Merged
merged 4 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions .github/actions/verify-gha-refs/Check-Called-GHA-Refs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ $mismatchRefs = Get-ChildItem -Path $PathIncludeList -Include $FileIncludeList -

if ($mismatchRefs.Count -gt 0)
{
Write-Output '> :warning: Warning :warning:' >> $env:GITHUB_STEP_SUMMARY
Write-Output '> Your pull request branch may be outdated if you see errors for files you did not edit. Please merge the target branch to resolve these errors.' >> $env:GITHUB_STEP_SUMMARY

"These called GitHub Actions and Workflows do not match expected ref '$ExpectedRef'." >> $env:GITHUB_STEP_SUMMARY

foreach ($mismatch in $mismatchRefs)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/validate-this-gha-refs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ jobs:

- name: Verify GitHub Actions Items Match Expected Ref (Pull)
if: github.event_name == 'pull_request' && steps.add-prefix.outputs.prefixed-files != '@()'
uses: Lombiq/GitHub-Actions/.github/actions/verify-gha-refs@dev
uses: Lombiq/GitHub-Actions/.github/actions/verify-gha-refs@issue/OSOE-517
with:
called-repo-base-include-list: '${{ steps.add-prefix.outputs.prefixed-files }}'
expected-ref: ${{ steps.determine-ref.outputs.expected-ref }}

- name: Verify GitHub Actions Items Match Expected Ref (Approved PR)
if: github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && steps.add-prefix.outputs.prefixed-files != '@()'
uses: Lombiq/GitHub-Actions/.github/actions/verify-gha-refs@dev
uses: Lombiq/GitHub-Actions/.github/actions/verify-gha-refs@issue/OSOE-517
with:
called-repo-base-include-list: '${{ steps.add-prefix.outputs.prefixed-files }}'
expected-ref: ${{ github.event.pull_request.base.ref }}

- name: Verify GitHub Actions Items Match Expected Ref (Push)
if: github.event_name == 'push'
uses: Lombiq/GitHub-Actions/.github/actions/verify-gha-refs@dev
uses: Lombiq/GitHub-Actions/.github/actions/verify-gha-refs@issue/OSOE-517
Loading