Skip to content

Conversation

@andrey-canon
Copy link
Collaborator

Description

This PR improves the GitHub Actions workflow responsible for creating Jira issues by:

  • Dynamically generating the story and sub-task information based on repository and pull request metadata.
  • Automatically assigning the appropriate deployment environment based on the target branch.

These changes enhance automation and reduce manual effort when tracking development work in Jira.

@andrey-canon andrey-canon force-pushed the and/jira-automation-trigger-on-synchronize branch 2 times, most recently from d6299f1 to 7d143df Compare July 4, 2025 22:58
@andrey-canon andrey-canon had a problem deploying to open-release/redwood.nelp July 4, 2025 22:58 — with GitHub Actions Failure
@andrey-canon andrey-canon temporarily deployed to open-release/redwood.nelp July 4, 2025 23:04 — with GitHub Actions Inactive
@andrey-canon andrey-canon force-pushed the and/jira-automation-trigger-on-synchronize branch from 7d143df to 35bf541 Compare July 7, 2025 14:30
@andrey-canon andrey-canon had a problem deploying to open-release/redwood.nelp July 7, 2025 14:30 — with GitHub Actions Failure
@andrey-canon andrey-canon force-pushed the and/jira-automation-trigger-on-synchronize branch from 7040518 to f83f302 Compare July 7, 2025 14:36
@andrey-canon andrey-canon had a problem deploying to open-release/redwood.nelp July 7, 2025 14:36 — with GitHub Actions Failure
@andrey-canon andrey-canon force-pushed the and/jira-automation-trigger-on-synchronize branch from f83f302 to 164a4a8 Compare July 7, 2025 14:49
@andrey-canon andrey-canon temporarily deployed to open-release/redwood.nelp July 7, 2025 14:49 — with GitHub Actions Inactive
@andrey-canon andrey-canon temporarily deployed to open-release/redwood.nelp July 7, 2025 14:49 — with GitHub Actions Inactive
@andrey-canon andrey-canon requested a review from johanseto July 7, 2025 14:50
@andrey-canon andrey-canon force-pushed the and/jira-automation-trigger-on-synchronize branch from 164a4a8 to c0fd40e Compare July 7, 2025 15:34
@andrey-canon andrey-canon temporarily deployed to open-release/redwood.nelp July 7, 2025 15:34 — with GitHub Actions Inactive
@andrey-canon andrey-canon temporarily deployed to open-release/redwood.nelp July 7, 2025 15:34 — with GitHub Actions Inactive
story_summary: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_SUMMARY }}
story_description: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_DESCRIPTION }}
steps:
- run: echo "Preparing input vars..."

Choose a reason for hiding this comment

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

This doesnt print anything

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that prints Preparing input vars...
image

- synchronize # Delete after testing and delete || github.event.action == 'synchronize'

jobs:
prepare:

Choose a reason for hiding this comment

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

I think this job could be removed and set the inputs directly in the jira-issue job

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That doesn't work since the create-jira-issue job requires environment variables and it's not possible to set any environment when the job implements a reusable workflow https://stackoverflow.com/questions/75386901/environments-in-github-actions-incompatible-with-reusable-workflows?utm_source=chatgpt.com

if: github.event.pull_request.merged == true || github.event.action == 'synchronize'
uses: nelc/actions-hub/.github/workflows/create-jira-issue.yml@and/jira_automation_action
with:
story_summary: ${{ needs.prepare.outputs.story_summary }}

Choose a reason for hiding this comment

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

Suggested change
story_summary: ${{ needs.prepare.outputs.story_summary }}
story_summary: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_SUMMARY }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This only works with repo variables, it's no possible to use environment variables

Choose a reason for hiding this comment

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

I think env.MIGRATION_BACKLOG_JIRA_STORY_SUMMARY doesnt work and vars yes. Or vars are not repo vars?. I mean here you could testing set env ${{ github.event.pull_request.base.ref }}.

https://docs.github.com/en/actions/reference/contexts-reference#contexts

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

uses: nelc/actions-hub/.github/workflows/create-jira-issue.yml@and/jira_automation_action
with:
story_summary: ${{ needs.prepare.outputs.story_summary }}
story_description: ${{ needs.prepare.outputs.story_description }}

Choose a reason for hiding this comment

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

Suggested change
story_description: ${{ needs.prepare.outputs.story_description }}
story_description: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_DESCRIPTION }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This only works with repo variables, it's no possible to use environment variables

@andrey-canon andrey-canon requested a review from johanseto July 7, 2025 21:49
subtask_description: "${{ github.event.pull_request.body }} 🔗 PR: ${{ github.event.pull_request.html_url }}"
environment: ${{ github.event.pull_request.base.ref }}
secrets:
MIGRATION_BACKLOG_JIRA_EMAIL: ${{ secrets.MIGRATION_BACKLOG_JIRA_EMAIL }}

Choose a reason for hiding this comment

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

So, how are these secrets being resolved if they are environment secrets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why vars don’t work in with:

GitHub evaluates that expression at the caller workflow level, before the reusable workflow starts.

At that point:

  • The environment has not been set yet.
  • So environment-scoped vars are not available.
  • As a result, the value is undefined or empty.

secrets are always available and injected early by GitHub — even at the top level.

@andrey-canon andrey-canon temporarily deployed to open-release/redwood.nelp July 8, 2025 21:07 — with GitHub Actions Inactive
@andrey-canon andrey-canon temporarily deployed to open-release/redwood.nelp July 8, 2025 21:07 — with GitHub Actions Inactive
@andrey-canon andrey-canon merged commit 1fb420e into open-release/redwood.nelp Jul 8, 2025
1 check passed
@andrey-canon andrey-canon temporarily deployed to open-release/redwood.nelp July 8, 2025 21:25 — with GitHub Actions Inactive
@andrey-canon andrey-canon had a problem deploying to open-release/redwood.nelp July 8, 2025 21:25 — with GitHub Actions Failure
@andrey-canon andrey-canon had a problem deploying to open-release/redwood.nelp July 8, 2025 21:27 — with GitHub Actions Failure
@andrey-canon andrey-canon temporarily deployed to open-release/redwood.nelp July 8, 2025 21:28 — with GitHub Actions Inactive
@andrey-canon andrey-canon deployed to open-release/redwood.nelp July 8, 2025 21:28 — with GitHub Actions Active
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.

3 participants