fix: again cl #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Changelog Pipeline | |
on: | |
push: | |
branches: ["develop"] | |
pull_request: | |
branches: ["develop"] | |
workflow_dispatch: | |
jobs: | |
update-changelog2: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Generate unreleased changelog | |
uses: orhun/git-cliff-action@v2 | |
id: generate_unreleased_changelog | |
with: | |
config: ./cliff.toml | |
args: --unreleased --bump | |
env: | |
OUTPUT: CHANGELOG.md | |
- name: Print the changelog | |
run: cat "${{ steps.generate_unreleased_changelog.outputs.changelog }}" | |
- name: Format changelog for Slack | |
id: format_for_slack | |
run: | | |
output=$(python scripts/changelog_slack.py ${{ steps.generate_unreleased_changelog.outputs.changelog }}) | |
echo "::set-output name=formatted_json::$output" | |
echo "Formatted JSON output for debugging: $output" | |
echo "Changelog for debugging: ${{ steps.generate_unreleased_changelog.outputs.changelog }}" | |
env: | |
UNRELEASED_CHANGELOG: ${{ steps.generate_unreleased_changelog.outputs.changelog }} | |
# - name: Debug Python | |
# id: debug_python | |
# run: | | |
# echo "Debug2 Python output for debugging: ${{ steps.format_for_slack.outputs.formatted_json }}" | |
- name: Send custom JSON data to Slack workflow | |
uses: slackapi/slack-github-action@v1.25.0 | |
with: | |
channel-id: "C06N79SSDD5" | |
payload: ${{ steps.format_for_slack.outputs.formatted_json }} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: Update CHANGELOG.md | |
uses: orhun/git-cliff-action@v2 | |
with: | |
config: ./cliff.toml | |
args: --bump | |
env: | |
OUTPUT: CHANGELOG.md | |
- name: Commit and push changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "chore(changelog): update changelog [skip ci]" | |
- name: Print New Tag | |
id: print_new_tag | |
run: | | |
echo "New Tag: ${{ steps.generate_unreleased_changelog.outputs.version }}" | |
- name: Create and push tag | |
env: | |
NEW_TAG: ${{ steps.generate_unreleased_changelog.outputs.version }} | |
run: | | |
git tag $NEW_TAG -m "Version $NEW_TAG" | |
git push origin $NEW_TAG -m "Version $NEW_TAG" | |
# Optional: Create GitHub release | |
- name: Create GitHub Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NEW_TAG: ${{ steps.generate_unreleased_changelog.outputs.version }} | |
with: | |
tag_name: ${{ env.NEW_TAG }} | |
release_name: Release ${{ env.NEW_TAG }} | |
body: ${{ steps.generate_unreleased_changelog.outputs.changelog }} | |