Skip to content

Test early failure using workflow_call#4671

Closed
Aaron1011 wants to merge 6 commits intomainfrom
aaron/wrap-general
Closed

Test early failure using workflow_call#4671
Aaron1011 wants to merge 6 commits intomainfrom
aaron/wrap-general

Conversation

@Aaron1011
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings November 17, 2025 21:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR tests early failure behavior in GitHub Actions workflows by introducing a wrapper workflow that calls the general workflow via workflow_call, and adds an intentional fake error step that exits with code 1. The PR also removes the pull_request trigger from the general workflow.

  • Adds a new wrapper workflow (wrapper-general.yml) that invokes the general workflow
  • Introduces a fake error step in the version consistency check job to test early failure handling
  • Removes pull_request trigger from the general workflow

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/wrapper-general.yml New wrapper workflow that calls general.yml using workflow_call pattern with inherited secrets
.github/workflows/general.yml Adds workflow_call trigger, removes pull_request trigger, and adds a fake error step for testing
Comments suppressed due to low confidence (1)

.github/workflows/general.yml:48

  • The check-if-edited-then-edit job condition references github.event.pull_request.labels, but the pull_request trigger has been removed from this workflow. This condition will always evaluate based on a null pull_request object when the workflow is triggered by workflow_call, merge_group, or workflow_dispatch, potentially causing unexpected behavior. Consider updating the condition to handle non-PR contexts.
    if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-if-edited-check') }}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -2,11 +2,10 @@ name: General Checks
run-name: "General Checks for: ${{ github.event.pull_request.title || github.ref }}"
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The run-name references github.event.pull_request.title, but the pull_request trigger has been removed from this workflow. When called via workflow_call or triggered by merge_group or workflow_dispatch, github.event.pull_request.title will be null, making the fallback to github.ref always occur. Consider updating to reflect the supported trigger types or removing the pull_request reference.

Suggested change
run-name: "General Checks for: ${{ github.event.pull_request.title || github.ref }}"
run-name: "General Checks for: ${{ github.ref }}"

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings November 17, 2025 21:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,25 @@
on:
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow is missing a name field. All other workflows in the repository include a name field at the top of the file (e.g., 'name: General Checks' in general.yml). Consider adding a descriptive name like name: Wrapper for General Checks to maintain consistency with other workflow files.

Copilot uses AI. Check for mistakes.
- name: Check version consistency
run: ./ci/check-version-consistency.sh

- name: Fake error
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fake error step causes the workflow to always fail. While this appears intentional for testing purposes based on the PR title, this will block the workflow from completing successfully in production. Consider adding a conditional check (e.g., if: github.event_name == 'workflow_call' && github.ref == 'refs/heads/aaron/wrap-general') to ensure this step only runs during testing and doesn't affect normal workflow execution.

Suggested change
- name: Fake error
- name: Fake error
if: github.event_name == 'workflow_call' && github.ref == 'refs/heads/aaron/wrap-general'

Copilot uses AI. Check for mistakes.
@Aaron1011 Aaron1011 closed this Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant