|
| 1 | +# This GitHub Actions workflow synchronizes GitHub issues, comments, and pull requests with Jira. |
| 2 | +# It triggers on new issues, issue comments, and on a scheduled basis. |
| 3 | +# The workflow uses a custom action to perform the synchronization with Jira (espressif/sync-jira-actions). |
| 4 | + |
| 5 | +name: 🔷 Sync to Jira |
| 6 | + |
| 7 | +run-name: > |
| 8 | + Sync to Jira - |
| 9 | + ${{ github.event_name == 'issue_comment' && 'Issue Comment' || |
| 10 | + github.event_name == 'schedule' && 'New Pull Requests' || |
| 11 | + github.event_name == 'issues' && 'New Issue' || |
| 12 | + github.event_name == 'workflow_dispatch' && 'Manual Sync' }} |
| 13 | +
|
| 14 | +on: |
| 15 | + issues: {types: [opened]} |
| 16 | + issue_comment: {types: [created, edited, deleted]} |
| 17 | + schedule: [cron: '0 * * * *'] |
| 18 | + workflow_dispatch: |
| 19 | + inputs: |
| 20 | + action: {description: 'Action to be performed', required: true, default: 'mirror-issues'} |
| 21 | + issue-numbers: {description: 'Issue numbers to sync (comma-separated)', required: true} |
| 22 | + |
| 23 | +# Limit to single concurrent run, in case this workflow is triggered multiple times in quick succession |
| 24 | +concurrency: jira_sync |
| 25 | + |
| 26 | +jobs: |
| 27 | + sync-to-jira: |
| 28 | + name: > |
| 29 | + Sync to Jira - |
| 30 | + ${{ github.event_name == 'issue_comment' && 'Issue Comment' || |
| 31 | + github.event_name == 'schedule' && 'New Pull Requests' || |
| 32 | + github.event_name == 'issues' && 'New Issue' || |
| 33 | + github.event_name == 'workflow_dispatch' && 'Manual Sync' }} |
| 34 | + runs-on: ubuntu-latest |
| 35 | + if: ${{ github.repository_owner == 'espressif' }} |
| 36 | + permissions: |
| 37 | + contents: read |
| 38 | + issues: write |
| 39 | + pull-requests: write |
| 40 | + steps: |
| 41 | + - name: Check out |
| 42 | + uses: actions/checkout@v5 |
| 43 | + |
| 44 | + - name: Run synchronization to Jira |
| 45 | + uses: espressif/sync-jira-actions@v1 |
| 46 | + with: |
| 47 | + cron_job: ${{ github.event_name == 'schedule' && 'true' || '' }} |
| 48 | + env: |
| 49 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + JIRA_PASS: ${{ secrets.JIRA_PASS }} |
| 51 | + JIRA_PROJECT: IEC |
| 52 | + JIRA_URL: ${{ secrets.JIRA_URL }} |
| 53 | + JIRA_USER: ${{ secrets.JIRA_USER }} |
0 commit comments