diff --git a/.github/workflows/dangerjs.yml b/.github/workflows/dangerjs.yml index afb408c..b6b1df2 100644 --- a/.github/workflows/dangerjs.yml +++ b/.github/workflows/dangerjs.yml @@ -12,15 +12,7 @@ jobs: pull-request-style-linter: runs-on: ubuntu-latest steps: - - name: Check out PR head - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: DangerJS pull request linter uses: espressif/shared-github-dangerjs@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - instructions-contributions-file: CONTRIBUTING.rst - instructions-gitlab-mirror: 'true' diff --git a/.github/workflows/issue_comment.yml b/.github/workflows/issue_comment.yml deleted file mode 100644 index c1388ce..0000000 --- a/.github/workflows/issue_comment.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Sync issue comments to JIRA - -# This workflow will be triggered when new issue comment is created (including PR comments) -on: issue_comment - -jobs: - sync_issue_comments_to_jira: - name: Sync Issue Comments to Jira - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Sync issue comments to JIRA - uses: espressif/sync-jira-actions@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_PASS: ${{ secrets.JIRA_PASS }} - JIRA_PROJECT: IDFGH - JIRA_COMPONENT: tools - JIRA_URL: ${{ secrets.JIRA_URL }} - JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.github/workflows/new_issues.yml b/.github/workflows/new_issues.yml deleted file mode 100644 index 6507b58..0000000 --- a/.github/workflows/new_issues.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Sync issues to Jira - -# This workflow will be triggered when a new issue is opened -on: issues - -jobs: - sync_issues_to_jira: - name: Sync issues to Jira - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Sync GitHub issues to Jira project - uses: espressif/sync-jira-actions@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_PASS: ${{ secrets.JIRA_PASS }} - JIRA_PROJECT: IDFGH - JIRA_COMPONENT: tools - JIRA_URL: ${{ secrets.JIRA_URL }} - JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.github/workflows/new_prs.yml b/.github/workflows/new_prs.yml deleted file mode 100644 index cd328e3..0000000 --- a/.github/workflows/new_prs.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Sync remain PRs to Jira - -# This workflow will be triggered every hour, to sync remaining PRs (i.e. PRs with zero comment) to Jira project -# Note that, PRs can also get synced when new PR comment is created -on: - schedule: - - cron: 0 * * * * - -jobs: - sync_prs_to_jira: - name: Sync PRs to Jira - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Sync PRs to Jira project - uses: espressif/sync-jira-actions@v1 - with: - cron_job: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_PASS: ${{ secrets.JIRA_PASS }} - JIRA_PROJECT: IDFGH - JIRA_COMPONENT: tools - JIRA_URL: ${{ secrets.JIRA_URL }} - JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.github/workflows/sync-jira.yml b/.github/workflows/sync-jira.yml new file mode 100644 index 0000000..c597aaf --- /dev/null +++ b/.github/workflows/sync-jira.yml @@ -0,0 +1,51 @@ +name: 🔷 Sync to Jira + +run-name: > + Sync to Jira - + ${{ github.event_name == 'issue_comment' && 'Issue Comment' || + github.event_name == 'schedule' && 'New Pull Requests' || + github.event_name == 'issues' && format('Issue ({0})', github.event.action) || + github.event_name == 'workflow_dispatch' && 'Manual Sync' }} + +on: + # No `types` under `issues` — runs on every issues activity (opened, edited, closed, labeled, …). + issues: + issue_comment: + types: [created, edited, deleted] + schedule: + - cron: 0 * * * * + workflow_dispatch: + inputs: + action: + description: Action to be performed + required: true + default: mirror-issues + issue-numbers: + description: Issue numbers to sync (comma-separated) + required: true + +jobs: + sync-to-jira: + name: > + Sync to Jira - + ${{ github.event_name == 'issue_comment' && 'Issue Comment' || + github.event_name == 'schedule' && 'New Pull Requests' || + github.event_name == 'issues' && format('Issue ({0})', github.event.action) || + github.event_name == 'workflow_dispatch' && 'Manual Sync' }} + runs-on: ubuntu-latest + permissions: + contents: read + issues: write + pull-requests: write + steps: + - name: Run synchronization to Jira + uses: espressif/sync-jira-actions@v1 + with: + cron_job: ${{ github.event_name == 'schedule' && 'true' || '' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JIRA_PASS: ${{ secrets.JIRA_PASS }} + JIRA_PROJECT: IDFGH + JIRA_COMPONENT: tools + JIRA_URL: ${{ secrets.JIRA_URL }} + JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f82f1be..ca91443 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,3 +47,4 @@ repos: rev: 1.19.1 hooks: - id: yamlfix + exclude: ^.github/workflows/.*\.ya?ml$