-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| name: Trigger Jira Issue Creation | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| types: | ||||||
| - closed | ||||||
|
|
||||||
| jobs: | ||||||
| prepare: | ||||||
| runs-on: ubuntu-latest | ||||||
| environment: | ||||||
| name: ${{ github.event.pull_request.base.ref }} | ||||||
| outputs: | ||||||
| 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 commentThe reason will be displayed to describe this comment to others. Learn more. This doesnt print anything
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| create-jira-issue: | ||||||
| needs: prepare | ||||||
| if: github.event.pull_request.merged == true | ||||||
| uses: nelc/actions-hub/.github/workflows/create-jira-issue.yml@main | ||||||
| with: | ||||||
| story_summary: ${{ needs.prepare.outputs.story_summary }} | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I think https://docs.github.com/en/actions/reference/contexts-reference#contexts
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| story_description: ${{ needs.prepare.outputs.story_description }} | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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_summary: "${{ github.event.pull_request.title }}" | ||||||
| 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 commentThe reason will be displayed to describe this comment to others. Learn more. So, how are these secrets being resolved if they are environment secrets?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
secrets are always available and injected early by GitHub — even at the top level. |
||||||
| MIGRATION_BACKLOG_JIRA_TOKEN: ${{ secrets.MIGRATION_BACKLOG_JIRA_TOKEN }} | ||||||
| MIGRATION_BACKLOG_JIRA_URL: ${{ secrets.MIGRATION_BACKLOG_JIRA_URL }} | ||||||
| MIGRATION_BACKLOG_JIRA_PROJECT: ${{ secrets.MIGRATION_BACKLOG_JIRA_PROJECT }} | ||||||
| MIGRATION_BACKLOG_JIRA_EPIC_KEY: ${{ secrets.MIGRATION_BACKLOG_JIRA_EPIC_KEY }} | ||||||
| MIGRATION_BACKLOG_JIRA_EPIC_LINK_FIELD: ${{ secrets.MIGRATION_BACKLOG_JIRA_EPIC_LINK_FIELD }} | ||||||


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-issuejob 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