Skip to content

Commit

Permalink
chore: clean up and slack clean up message
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Padhy <100484401+Shurtu-gal@users.noreply.github.com>
  • Loading branch information
Shurtu-gal committed Feb 8, 2025
1 parent 14d6da8 commit 5131c8a
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/auto-changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
- opened
- edited

# startsWith(github.repository, 'asyncapi/') &&
jobs:
auto-changeset:
if: |
startsWith(github.repository, 'asyncapi/') &&
( startsWith(github.event.pull_request.title, 'fix:') ||
startsWith(github.event.pull_request.title, 'feat:') ||
startsWith(github.event.pull_request.title, 'fix!:') ||
Expand All @@ -21,10 +21,12 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}

- name: Checkout PR
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: gh pr checkout ${{ github.event.pull_request.number }}

- name: Determine release type
id: determine_release_type
uses: actions/github-script@v7
Expand All @@ -44,15 +46,27 @@ jobs:
default:
return 'patch';
}
- name: Create changeset file
run: "echo -e '---\n'@asyncapi/cli': ${{ steps.determine_release_type.outputs.result }}\n---\n\n ${{ github.event.pull_request.title }}\n\n' > .changeset/${{ github.event.pull_request.number }}.md"
run: "echo -e '---\n'@asyncapi/cli': ${{ steps.determine_release_type.outputs.result }}\n---\n\n ${{ github.event.pull_request.title }}\n' > .changeset/${{ github.event.pull_request.number }}.md"

- name: Commit changeset file
run: |
git config --global user.email "info@asyncapi.com"
git config --global user.name "asyncapi-bot"
git config --global user.name asyncapi-bot
git config --global user.email info@asyncapi.io
git add .changeset/${{ github.event.pull_request.number }}.md
git commit -m "chore: add changeset for PR #${{ github.event.pull_request.number }}"
# - name: Debug event
# run: echo ${{ toJson(github.event) }}
- name: Push changeset file
run: git push https://${{ secrets.GH_TOKEN }}@github.com/${{ github.event.pull_request.head.repo.full_name }} HEAD:${{ github.event.pull_request.head.ref }}
run: git push https://${{ secrets.GH_TOKEN }}@github.com/${{ github.event.pull_request.head.repo.full_name }} HEAD:${{ github.event.pull_request.head.ref }}

# Only, on failure, send a message on the 94_bot-failing-ci slack channel
- if: failure()
name: Report workflow run status to Slack
uses: 8398a7/action-slack@fbd6aa58ba854a740e11a35d0df80cb5d12101d8 #using https://github.com/8398a7/action-slack/releases/tag/v3.15.1
with:
status: ${{ job.status }}
fields: repo,action,workflow
text: 'AsyncAPI CLI release to Chocolatey failed'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }}

0 comments on commit 5131c8a

Please sign in to comment.