You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello folks,
This is a series of articles where I explain GitHub Script with GitHub Actions and how you can automate publishing data on Atlassian & GitHub Platform based on the results of Workflow.
For example, let us have look at sample workflow.
If the Build is successful, github-actions bot will comment success and if fails it will comment failure.
YAML File under .github/workflows directory in GitHub Repository
name: CI Workflow
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Get Pull Request ID
run: |
export PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
echo "pr_num=$PR_NUMBER" >> $GITHUB_ENV
- name: Add Comment to Pull Request if Success
if: ${{ success() }}
uses: actions/github-script@v5
with:
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ env.pr_num }},
body: 'Its Success'
});
- name: Add Comment to Pull Request if Failure
if: ${{ failure() }}
uses: actions/github-script@v5
with:
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ env.pr_num }},
body: 'Its Failure'
});
This example will get you started with Automations that can be carried out with GitHub Actions and Jira Platform for seamless integration between the applications.
Please follow the link here to know about verified actions available in GitHub Marketplace from Atlassian.
Thanks,
Pramodh
Pramodh M
DevSecOps Architect
Bengaluru
644 accepted answers
1 comment