From 021b60928a31297299c1575ea82923380c3165da Mon Sep 17 00:00:00 2001 From: Merit <11151764+meritmalling@users.noreply.github.com> Date: Thu, 11 Jul 2024 09:36:40 -0700 Subject: [PATCH] Trigger on release published, remove auth from other actions (#558) * Trigger on release published, remove auth from other actions Signed-off-by: Merit * Add tag param Signed-off-by: Merit * Update version Signed-off-by: Merit --------- Signed-off-by: Merit --- .github/workflows/changesets.yml | 6 +----- .github/workflows/cl-create.yml | 19 ++++++------------- .github/workflows/lint.yml | 3 --- .github/workflows/test.yml | 5 +---- package-lock.json | 8 ++++---- package.json | 2 +- 6 files changed, 13 insertions(+), 30 deletions(-) diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index a3ac229cb..292cfe568 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -20,11 +20,7 @@ jobs: with: node-version: 18.x cache: npm - - - name: Authenticate with private NPM package - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc - - + - name: Install dependencies run: npm ci diff --git a/.github/workflows/cl-create.yml b/.github/workflows/cl-create.yml index 503e3db10..c7ef1e744 100644 --- a/.github/workflows/cl-create.yml +++ b/.github/workflows/cl-create.yml @@ -1,10 +1,8 @@ -name: Create a changelog update +name: Changelog on: - push: - tags: - - '@**' - - '**' + release: + types: [published] jobs: changelog: @@ -25,11 +23,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Set tag variable - run: | - TAG_NAME=${GITHUB_REF#refs/tags/} - echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV - - name: Set variables from cl-config.yml run: | destinationRepo=$(yq e '.destinationRepo' cl-config.yml) @@ -39,7 +32,7 @@ jobs: echo "DESTINATION_DIRECTORY=${destinationDirectory}" >> $GITHUB_ENV - name: Create a changelog update - run: npx changelog generate ${{ env.TAG_NAME }} + run: npx changelog generate tag ${{ github.event.release.tag_name }} env: CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }} @@ -56,7 +49,7 @@ jobs: source_file: temp/${{ env.FILE_NAME}} destination_repo: ${{ env.DESTINATION_REPO }} destination_folder: changelog/src/${{ env.DESTINATION_DIRECTORY }} - destination_branch_create: changelog/${{ env.TAG_NAME }} + destination_branch_create: changelog/${{ github.event.release.tag_name }} user_email: ${{ github.actor }} user_name: github-actions[bot] - commit_message: "Updating the changelog for ${{ env.TAG_NAME }}" \ No newline at end of file + commit_message: "Updating the changelog for ${{ github.event.release.tag_name }}" \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 38e867ab5..664f58581 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,9 +24,6 @@ jobs: node-version: 16.x cache: 'npm' - - name: Authenticate with private NPM package - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc - - name: Install Dependencies run: npm ci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a2dc0727..ed2b60e46 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,10 +24,7 @@ jobs: with: node-version: 16 cache: 'npm' - - - name: Authenticate with private NPM package - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc - + - name: Install dependencies run: npm ci diff --git a/package-lock.json b/package-lock.json index c964a7978..469557740 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,7 @@ "node": ">=16" }, "optionalDependencies": { - "@flatfile/changelog": "^0.0.3", + "@flatfile/changelog": "^1.0.0", "@parcel/watcher-linux-x64-glibc": "^2.3.0", "@rollup/rollup-linux-x64-gnu": "^4.8.0" } @@ -3477,9 +3477,9 @@ } }, "node_modules/@flatfile/changelog": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@flatfile/changelog/-/changelog-0.0.3.tgz", - "integrity": "sha512-mem3tXTUzuEbEBwt1T3FF3RCm32wNfqIoyvtKMf1v/NEFBZrF5I8E45yGylfy6CFYNDjcSgnIOBCgq4f+UDXVQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@flatfile/changelog/-/changelog-1.0.0.tgz", + "integrity": "sha512-tkT3fEnbvylXrt3AJqJypva/YpnMgQLYqA3pxgzJNZgqbb8BXFVN/H6lDQOsP0j6q/9uySacDyJlOcdppsld8g==", "optional": true, "dependencies": { "chalk": "^4.1.2", diff --git a/package.json b/package.json index 0748961af..5992e4858 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "optionalDependencies": { "@parcel/watcher-linux-x64-glibc": "^2.3.0", "@rollup/rollup-linux-x64-gnu": "^4.8.0", - "@flatfile/changelog": "^0.0.3" + "@flatfile/changelog": "^1.0.0" } }