From a8c0ffd33ec27754c4fb06f0d289761f7bf11836 Mon Sep 17 00:00:00 2001 From: Masoud Ghorbani Date: Mon, 18 Dec 2023 23:07:41 +0100 Subject: [PATCH] chore: set GITHUB_TOKEN --- .github/workflows/changelog.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index d32c56b..6e0a39f 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -17,10 +17,27 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v2 with: - node-version: 14 + node-version: 'lts/20' # Ensure this version matches your project's requirements - name: Install dependencies - run: npm ci + run: npm ci # 'npm ci' is more efficient and reliable for CI/CD environments + + - name: Configure Git identity + run: | + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + git config --global user.name "${GITHUB_ACTOR}" + env: + GITHUB_ACTOR: ${{ github.actor }} - name: Update Changelog - run: npx standard-version --release-as ${{ github.event.pull_request.title }} + run: npx standard-version --release-as "${{ github.event.pull_request.title }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Include this if your script interacts with GitHub API + + - name: Commit and Push Changes + run: | + git add CHANGELOG.md package.json package-lock.json + git commit -m "chore(release): Update Changelog for PR ${{ github.event.pull_request.number }}" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required for pushing changes