From b6cf39d0cde692360a031d047defedadb9b2134e Mon Sep 17 00:00:00 2001 From: Jason Salaber Date: Fri, 10 May 2024 11:45:02 -0400 Subject: [PATCH] chore: added action to output changelog --- .github/workflows/build-changelog.yml | 53 +++++++++++++++++++++++++++ sdk/react/CHANGELOG.md | 0 sdk/react/project.json | 7 ++++ 3 files changed, 60 insertions(+) create mode 100644 .github/workflows/build-changelog.yml create mode 100644 sdk/react/CHANGELOG.md diff --git a/.github/workflows/build-changelog.yml b/.github/workflows/build-changelog.yml new file mode 100644 index 000000000..8d705c5cc --- /dev/null +++ b/.github/workflows/build-changelog.yml @@ -0,0 +1,53 @@ +name: Build Changelog + +on: + pull_request + +jobs: + build-changelog: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + env: + # The setup-node action configures this env var as the source for the npm auth token + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + steps: + # Check out the repo with credentials that can bypass branch protection, and fetch git history instead of just latest commit + - uses: actions/checkout@v4 + with: + token: ${{ secrets.AUTOMATION_USER_TOKEN }} + fetch-depth: 0 + + - name: Configure git + run: | + git config --global user.email "github-tracker-bot@taplytics.com" + git config --global user.name "DevCycle Automation" + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + cache: 'yarn' + + - name: Validate npm config and auth + run: | + npm config list + npm whoami + + - run: yarn --immutable + + - name: Build Changelog + id: changelog + uses: mikepenz/release-changelog-builder-action@v4.2.2 + with: + ignorePreReleases: true + path: ./ + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Output Changelog + run: echo "${{ steps.github_release.outputs.changelog }}" + diff --git a/sdk/react/CHANGELOG.md b/sdk/react/CHANGELOG.md new file mode 100644 index 000000000..e69de29bb diff --git a/sdk/react/project.json b/sdk/react/project.json index 62b754c22..72828e00a 100644 --- a/sdk/react/project.json +++ b/sdk/react/project.json @@ -73,6 +73,13 @@ "codeCoverage": true } }, + "build-changelog": { + "executor": "nx:run-commands", + "options": { + "command": "yarn run -T standard-version", + "cwd": "sdk/react" + } + }, "npm-publish": { "executor": "nx:run-commands", "options": {