diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml index 1848c030357..c1da256ea6f 100644 --- a/.github/actions/release/action.yml +++ b/.github/actions/release/action.yml @@ -1,9 +1,19 @@ name: "tag version" description: "Tag package" inputs: - jira_token: + jira_api_token: description: "Token to authenticate to Jira" required: true + jira_user_email: + description: "Email linked to token" + required: true + jira_project_id: + description: "Jira project id to create release" + required: true + jira_base_url: + description: "Jira base url" + required: true + runs: using: "composite" steps: @@ -44,11 +54,11 @@ runs: TYPE=Release fi - VERSION_DATA="{\"archived\":false,\"releaseDate\":\"$(date +%Y-%m-%d)\",\"name\":\"centreon-collect-$NEW_VERSION\",\"description\":\"$TYPE:$RELEASE_ID\",\"projectId\":11789,\"released\":false}" + VERSION_DATA="{\"archived\":false,\"releaseDate\":\"$(date +%Y-%m-%d)\",\"name\":\"centreon-collect-$NEW_VERSION\",\"description\":\"$TYPE:$RELEASE_ID\",\"projectId\":${{ inputs.jira_project_id }},\"released\":false}" curl --fail --request POST \ - --url 'https://centreon.atlassian.net/rest/api/3/version' \ - --header 'Authorization: Basic ${{ inputs.jira_token }}' \ + --url '${{ inputs.jira_base_url }}/rest/api/3/version' \ + --user '${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data ''$VERSION_DATA'' diff --git a/.github/workflows/release-collect.yml b/.github/workflows/release-collect.yml index b11bf369697..ed2cecbf068 100644 --- a/.github/workflows/release-collect.yml +++ b/.github/workflows/release-collect.yml @@ -31,4 +31,7 @@ jobs: id: release uses: ./.github/actions/release with: - jira_token: ${{ secrets.JIRA_TOKEN }} + jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }} + jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }} + jira_project_id: ${{ secrets.JIRA_PROJECT_ID }} + jira_base_url: ${{ secrets.JIRA_BASE_URL }}