From a2b234002c0846c85e35a18ae4738f89b9c9c4fe Mon Sep 17 00:00:00 2001 From: "ugo.bechameil" Date: Sun, 25 Oct 2026 23:31:37 +0100 Subject: [PATCH] ci: use the shared hackolade/plugin-workflows workflows The three CI workflows now call the reusable workflows of hackolade/plugin-workflows (@v1), with the same triggers and settings. Actions are pinned by commit SHA, jira-description-action moves from v0.9.0 to v.10.0.0, and the TeamCity trigger now fails when TeamCity rejects the request. Co-Authored-By: Opus 5.5 --- .github/workflows/jira_link_to_pr.yml | 30 ++++++--------- .github/workflows/notif-push-to-slack.yml | 38 +++++-------------- .../workflows/trigger-pr-tests-plugins.yml | 21 +++++----- 3 files changed, 31 insertions(+), 58 deletions(-) diff --git a/.github/workflows/jira_link_to_pr.yml b/.github/workflows/jira_link_to_pr.yml index 53efb67..1d17971 100644 --- a/.github/workflows/jira_link_to_pr.yml +++ b/.github/workflows/jira_link_to_pr.yml @@ -1,23 +1,15 @@ -# https://github.com/marketplace/actions/jira-description -# Requires a JIRA REST api token: https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/ -# https://id.atlassian.com/manage-profile/security/api-tokens to generate one with you username -# Configure the JIRA_TOKEN secret as a repository action secret as described below: -# follow the pattern: : -name: jira-description-action +name: Link the Jira issue + on: pull_request: types: [opened, reopened] + +permissions: + contents: read + pull-requests: write + jobs: - add-jira-description: - runs-on: ubuntu-latest - steps: - - uses: cakeinpanic/jira-description-action@v0.9.0 - name: jira-description-action - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - jira-token: ${{ secrets.JIRA_TOKEN }} - jira-base-url: https://hackolade.atlassian.net - skip-branches: '^(develop|main|master)$' #optional - jira-project-key: 'HCK' #optional - use: 'both' - fail-when-jira-issue-not-found: false + jira: + uses: hackolade/plugin-workflows/.github/workflows/jira-link-pr.yml@v1 + secrets: + jira-token: ${{ secrets.JIRA_TOKEN }} diff --git a/.github/workflows/notif-push-to-slack.yml b/.github/workflows/notif-push-to-slack.yml index 61315cd..4e6a409 100644 --- a/.github/workflows/notif-push-to-slack.yml +++ b/.github/workflows/notif-push-to-slack.yml @@ -1,34 +1,16 @@ -#https://docs.github.com/en/webhooks/webhook-events-and-payloads#push name: notify-push + on: push: branches: - - develop + - develop + +permissions: + contents: read + jobs: notify: - runs-on: ubuntu-latest - env: - AUTHOR: ${{ github.event.pusher.name }} - COMMIT_PUSH_SOURCE: ${{ secrets.COMMIT_PUSH_SOURCE }} - steps: - - name: notify slack - id: slack - if: ${{ env.AUTHOR == env.COMMIT_PUSH_SOURCE }} - uses: slackapi/slack-github-action@v1.26.0 - with: - channel-id: 'develop-direct-pushes' - payload: | - { - "text": " ${{ github.event.head_commit.url }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Push: ${{ github.event.head_commit.url }}" - } - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + uses: hackolade/plugin-workflows/.github/workflows/notify-direct-push.yml@v1 + secrets: + slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} + commit-push-source: ${{ secrets.COMMIT_PUSH_SOURCE }} diff --git a/.github/workflows/trigger-pr-tests-plugins.yml b/.github/workflows/trigger-pr-tests-plugins.yml index 3874282..82435df 100644 --- a/.github/workflows/trigger-pr-tests-plugins.yml +++ b/.github/workflows/trigger-pr-tests-plugins.yml @@ -4,16 +4,15 @@ on: pull_request: types: [auto_merge_enabled] +permissions: + contents: read + jobs: trigger-pr-tests-plugins: - name: Trigger PR tests (Plugins) - runs-on: ubuntu-latest - steps: - - name: Call TeamCity API endpoint - run: | - curl \ - -X POST \ - -H 'Authorization: Bearer ${{ secrets.TEAMCITY_TRIGGER_TESTS_TOKEN }}' \ - -H 'Content-Type: application/json' \ - -d '{"branchName": "pull/${{ github.event.number }}", "buildType": {"id": "${{ vars.TEAMCITY_BUILD_ID_FOR_TESTING_PLUGIN_PR }}"}, "properties": { "property": [ {"name": "BUILD_BRANCH", "value": "${{ github.event.pull_request.head.ref }}" }] }}' \ - ${{ vars.TEAMCITY_API_URL }}/buildQueue + uses: hackolade/plugin-workflows/.github/workflows/trigger-teamcity-build.yml@v1 + with: + teamcity-url: ${{ vars.TEAMCITY_API_URL }} + build-type-id: ${{ vars.TEAMCITY_BUILD_ID_FOR_TESTING_PLUGIN_PR }} + pass-build-branch: true + secrets: + teamcity-token: ${{ secrets.TEAMCITY_TRIGGER_TESTS_TOKEN }}