Skip to content

Commit

Permalink
changelog magic
Browse files Browse the repository at this point in the history
  • Loading branch information
gatzjames committed Feb 6, 2024
1 parent 297d39e commit fa78060
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Changelog

on: push

jobs:
changelog:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: develop
fetch-depth: 0

- name: Get version
shell: bash
run: |
echo "RELEASE_VERSION=$(node -e "console.log(require('./packages/insomnia/package.json').version)")" >> $GITHUB_ENV
echo "RELEASE_BRANCH=release/$(node -e "console.log(require('./packages/insomnia/package.json').version)")" >> $GITHUB_ENV
- name: Checkout branch
uses: actions/checkout@v3
with:
ref: ${{ env.RELEASE_BRANCH }}
persist-credentials: false

- name: Configure Git user
id: configure_git_user
uses: Homebrew/actions/git-user-config@master
with:
username: ${{ (github.event_name == 'workflow_dispatch' && github.actor) || 'insomnia-infra' }}

- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ secrets.RELEASE_GH_TOKEN }}
tag: ${{ github.ref_name }}

- name: Git Commit Changelog
run: git commit -am "update CHANGELOG.md for ${{ env.RELEASE_VERSION }} [skip ci]"

- name: Git Push changes
run: |
remote_repo="https://${GITHUB_ACTOR}:${RELEASE_GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git push "${remote_repo}" --follow-tags
env:
RELEASE_GH_TOKEN: ${{ secrets.RELEASE_GH_TOKEN }}

0 comments on commit fa78060

Please sign in to comment.