Run GitHub Actions from Jira Automation
You can start a GitHub Actions workflow from a Jira work item with Jira Automation alone, no app needed. This page shows the setup, how to get the result back onto the work item, and what's still missing afterwards.
1. Let the workflow be started from outside
Add a workflow_dispatch trigger with the inputs you want to pass from Jira. Declare them as
strings.
# .github/workflows/deploy.yml
on:
workflow_dispatch:
inputs:
issue_key: { type: string, required: true }
environment: { type: string, required: true }
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Deploy
env:
ENVIRONMENT: ${{ inputs.environment }}
run: ./scripts/deploy.sh "$ENVIRONMENT"2. Create a GitHub token
Automation calls the GitHub API with a token. Use a fine-grained personal access token limited to
the one repository, with Actions: Read and write. A classic token needs the repo scope, which
is much broader.
3. Build the rule
- Trigger: Manual trigger from work item. Pick the groups that may run it under Groups that
can run trigger. To ask for an environment, turn on Get input from users and add a field
named
environment. - Action: Send web request.
- URL:
https://api.github.com/repos/OWNER/REPO/actions/workflows/deploy.yml/dispatches - HTTP method:
POST - Headers:
Accept: application/vnd.github+jsonandAuthorization: Bearer <token>. Tick Hidden on the token so it shows as asterisks after saving. - Web request body: Custom data
- URL:
{
"ref": "main",
"inputs": {
"issue_key": "{{issue.key}}",
"environment": "{{userInputs.environment}}"
}
}People now start the workflow from the work item's Actions menu.
4. Get the result back
Automation only starts the run. For the work item to hear how it went, the workflow has to call the Jira REST API itself, with a Jira API token saved as a GitHub secret. For example, as the last step:
- name: Comment on the work item
if: always()
env:
JIRA_SITE: ${{ secrets.JIRA_SITE }}
JIRA_AUTH: ${{ secrets.JIRA_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}
ISSUE_KEY: ${{ inputs.issue_key }}
TEXT: 'Deploy ${{ job.status }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
run: |
jq -n --arg t "$TEXT" \
'{body: {type: "doc", version: 1, content: [{type: "paragraph", content: [{type: "text", text: $t}]}]}}' |
curl -sf -u "$JIRA_AUTH" -H 'Content-Type: application/json' \
-X POST "https://$JIRA_SITE/rest/api/3/issue/$ISSUE_KEY/comment" --data @-What this setup leaves out
- The next step. After a staging deploy, nothing offers Promote to production to the release manager or Roll back to the developers. Someone has to know which rule to run next.
- The run's state on the work item. It shows only the comments the workflow writes. There's no running, passed or failed state to look at.
- Tokens in two places. A GitHub token in the rule and a Jira token in GitHub, each owned by someone.
- Usage. Each run of the rule counts toward your Automation usage limit.
The same loop with Cuelight
Cuelight for Jira keeps your workflow and replaces steps 2 to 4. An admin connects GitHub once, and actions define the button, its form and who can press it. The workflow reports back with one step, and chooses which buttons come next:
- name: Report to Jira
if: always()
uses: huseyinbuyukdere/cuelight-report@v1
with:
status: ${{ job.status }}
next: promote-production, rollback-stagingMake the action and the workflow YAML in the action builder, or see the whole loop in the demo.