-
Notifications
You must be signed in to change notification settings - Fork 0
feat: trigger Jira issue automation on PR merge event #11
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
feat: trigger Jira issue automation on PR merge event #11
Conversation
d6299f1 to
7d143df
Compare
7d143df to
35bf541
Compare
7040518 to
f83f302
Compare
f83f302 to
164a4a8
Compare
164a4a8 to
c0fd40e
Compare
| story_summary: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_SUMMARY }} | ||
| story_description: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_DESCRIPTION }} | ||
| steps: | ||
| - run: echo "Preparing input vars..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesnt print anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - synchronize # Delete after testing and delete || github.event.action == 'synchronize' | ||
|
|
||
| jobs: | ||
| prepare: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| story_summary: ${{ needs.prepare.outputs.story_summary }} | |
| story_summary: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_SUMMARY }} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| story_description: ${{ needs.prepare.outputs.story_description }} | |
| story_description: ${{ vars.MIGRATION_BACKLOG_JIRA_STORY_DESCRIPTION }} |
There was a problem hiding this comment.
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
| 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 }} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.


Description
This PR improves the GitHub Actions workflow responsible for creating Jira issues by:
These changes enhance automation and reduce manual effort when tracking development work in Jira.