Skip to content

Commit

Permalink
fix(ci): update release action curl and workflows (#1155)
Browse files Browse the repository at this point in the history
* fix(ci): update release action curl and workflows

* add feedbacks

* add feedbacks
  • Loading branch information
tuntoja authored Feb 26, 2024
1 parent 6212a37 commit 6c441e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
18 changes: 14 additions & 4 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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''
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 6c441e2

Please sign in to comment.