Skip to content

Conversation

Copy link

Copilot AI commented Oct 24, 2025

Problem

The GitHub Actions workflow was failing with the error:

Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/openapi/openapi/.github/workflows/task-failure-handler.yml'. Did you forget to run actions/checkout before running your local action?

This occurred because the optional-spec-validations.yml workflow was incorrectly trying to use the task-failure-handler.yml reusable workflow as step-level actions:

- name: Create Issue - Postman validation Failed
  if: ${{ failure() && steps.spectral-validation.outcome == 'failure' }}
  uses: ./.github/workflows/task-failure-handler.yml  # ❌ Invalid usage

Solution

GitHub Actions reusable workflows cannot be called as steps within a job - they must be called at the job level. This PR restructures the workflow to use the proper pattern:

  1. Converted step-level calls to job-level calls: The error handling now uses separate jobs that call the reusable workflow correctly
  2. Added proper conditional execution: Jobs run conditionally based on validation outcomes using job outputs
  3. Fixed secret passing: Added the required jira_api_token secret to workflow definitions and ensured it's passed correctly from parent workflows

Changes

.github/workflows/optional-spec-validations.yml

  • Removed invalid step-level calls to task-failure-handler.yml
  • Added job outputs to track validation failure states
  • Created dedicated error handling jobs: postman-validation-error-handler and ipa-validation-error-handler
  • Added required jira_api_token secret definition

.github/workflows/release-spec.yml

  • Updated to pass the jira_api_token secret when calling optional-spec-validations.yml

Result

The workflow now follows GitHub Actions best practices and will no longer fail with the "action.yml not found" error. All original functionality is preserved - failed validations still create GitHub issues and JIRA tickets for tracking.

Fixes the workflow execution while maintaining the same error handling behavior for optional spec validations.

Original prompt

This section details on the original issue you should resolve

<issue_title>Github action fails with error when trying to create error jira</issue_title>
<issue_description>Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/openapi/openapi/.github/workflows/task-failure-handler.yml'. Did you forget to run actions/checkout before running your local action?</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix GitHub action fails when creating error Jira Fix GitHub Actions workflow error: Convert reusable workflow calls from steps to jobs Oct 24, 2025
Copilot AI requested a review from wtrocki October 24, 2025 14:54
Copilot finished work on behalf of wtrocki October 24, 2025 14:54
@andreaangiolillo andreaangiolillo self-requested a review October 24, 2025 14:59
@wtrocki wtrocki force-pushed the copilot/fix-github-action-error branch from 7bbfa3f to 8a798d1 Compare October 24, 2025 15:18
@wtrocki wtrocki closed this Oct 24, 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.

Github action fails with error when trying to create error jira

2 participants