/
sdds
/
plasma
Обзор
Документация
Войти
/
sdds
/
plasma
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
dev
.github/workflows/create-release-pr.yml
134 строки
5 KB
Alexander Lobyntsev
ci(release): fix FROM_TAG issue [no ci]
28 апр 2026, 07:11
28 апр 2026, 07:11
923dc47
Код
Авторство
О чём код?
# Default based by dev branch name: Create release PR and generate changelog on: push: branches: - 'release_*' workflow_dispatch: inputs: from-tag: description: '' required: false to-tag: description: '' required: true jobs: release-pr: name: Create release pull request # github.event.created is true only on the first push when branch is created # See: https://docs.github.com/en/webhooks/webhook-events-and-payloads#push if: github.event.created || github.event_name == 'workflow_dispatch' runs-on: ubuntu-22.04 env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} permissions: contents: read pull-requests: read steps: - name: Checkout uses: actions/checkout@v4 with: show-progress: false fetch-depth: 0 - name: Computed envs run: | echo "DATE=$(date +'%d.%m.%Y')" >> $GITHUB_ENV echo "FROM_TAG=$(git merge-base origin/master HEAD)" >> $GITHUB_ENV echo "FILE=${{ github.workspace }}/changelog_artifacts.md" >> $GITHUB_ENV - name: Build Changelog id: github_release uses: mikepenz/release-changelog-builder-action@v4.1.0 with: fromTag: ${{ github.event.inputs.from-tag || env.FROM_TAG }} toTag: ${{ github.event.inputs.to-tag }} ignorePreReleases: true configuration: './.github/changelog-builder-config.json' - name: List pull request # List merged pull request into dev branch run: echo "pull_requests --> ${{ steps.github_release.outputs.pull_requests }}" - name: Create "changelog_artifacts.md" # Write multiple lines input stream run: | cat > ${{ env.FILE }} <<'EOF' ${{ steps.github_release.outputs.changelog }} - name: Upload "changelog_artifacts.md" uses: actions/upload-artifact@master with: name: release-changelog-artifacts path: ${{ env.FILE }} - name: Install dependencies run: | cd .github/actions/preprocessing-release-changelog npm ci - name: Processing changelog data id: changelog uses: ./.github/actions/preprocessing-release-changelog with: data: | ${{ steps.github_release.outputs.changelog }} - name: Create release PR run: | changelog='${{ steps.changelog.outputs.changelog }}' gh pr create --base master --head ${{ github.ref_name }} --title "Release by ${{ env.DATE }}" --body "$changelog" - name: Processing pull request by title id: jira_tasks uses: actions/github-script@v7 env: PULL_REQUESTS_IDS: ${{ steps.github_release.outputs.pull_requests }} with: script: | const prIds = process.env.PULL_REQUESTS_IDS.split(',').map(id => parseInt(id, 10)); const ids = []; for (const prId of prIds) { try { const { data: pr } = await github.rest.pulls.get({ owner: 'salute-developers', repo: 'plasma', pull_number: prId }); const jiraIdMatch = pr.title.toLocaleLowerCase().match(/plasma-\d+/); const id = jiraIdMatch ? jiraIdMatch[0] : null; if (id) { ids.push(id); } } catch (error) { console.error(`Error fetching PR #${prId}:`, error); } } console.log('Found pull requests:', ids); return ids; - name: Send MM uses: mattermost/action-mattermost-notify@master with: MATTERMOST_WEBHOOK_URL: ${{ secrets.WEBHOOKS_RELEASE_LF_MM }} TEXT: |- { "name": "plasma", "version": "Release ${{ env.DATE }}", "applicationType": "web", "hotfix": false, "authorMmUser": "alex_czech", "configurationElement": "${{ secrets.CE }}", "distributionLink": "", "tasks": ${{ steps.jira_tasks.outputs.result }}, "jiraProject": "PLASMA" }