@@ -73,19 +73,17 @@ jobs:
7373 if : failure()
7474 run : npm run type-check
7575
76- update_changelog_and_version :
76+ calculate_beta_version :
7777 needs : [ release_metadata, wait_for_checks ]
78- name : Update changelog and prepare beta version
78+ name : Calculate beta version
7979 runs-on : ubuntu-latest
8080 outputs :
81- changelog_commitish : ${{ steps.commit.outputs.commit_long_sha || github.sha }}
8281 beta_version : ${{ steps.beta_version.outputs.version }}
8382
8483 steps :
8584 - name : Checkout repository
8685 uses : actions/checkout@v4
8786 with :
88- token : ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
8987 ref : ${{ github.event.pull_request.head.ref }}
9088 repository : ${{ github.event.pull_request.head.repo.full_name }}
9189
@@ -112,36 +110,22 @@ jobs:
112110 echo "version=$BETA_VERSION" >> $GITHUB_OUTPUT
113111 echo "Beta version calculated: $BETA_VERSION"
114112
115- - name : Update CHANGELOG.md only
116- uses : DamianReeves/write-file-action@master
117- with :
118- path : CHANGELOG.md
119- write-mode : overwrite
120- contents : ${{ needs.release_metadata.outputs.changelog }}
121-
122- - name : Commit changelog only
123- id : commit
124- uses : EndBug/add-and-commit@v9
125- with :
126- author_name : Apify Release Bot
127- 128- message : " chore(release): Update changelog for ${{ steps.beta_version.outputs.version }} [skip ci]"
129- add : ' CHANGELOG.md'
130- push : true
131-
132113 - name : Create and push beta tag
133114 run : |
134115 git tag "v${{ steps.beta_version.outputs.version }}"
135116 git push origin "v${{ steps.beta_version.outputs.version }}"
117+ env :
118+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
136119
137120 publish_to_npm :
138121 name : Publish to NPM
139- needs : [ update_changelog_and_version ]
122+ needs : [ calculate_beta_version ]
140123 runs-on : ubuntu-latest
141124 steps :
142125 - uses : actions/checkout@v4
143126 with :
144- ref : ${{ needs.update_changelog_and_version.outputs.changelog_commitish }}
127+ ref : ${{ github.event.pull_request.head.ref }}
128+ repository : ${{ github.event.pull_request.head.repo.full_name }}
145129
146130 - name : Use Node.js 22
147131 uses : actions/setup-node@v4
@@ -158,14 +142,14 @@ jobs:
158142
159143 - name : Set beta version in package.json
160144 run : |
161- BETA_VERSION="${{ needs.update_changelog_and_version .outputs.beta_version }}"
145+ BETA_VERSION="${{ needs.calculate_beta_version .outputs.beta_version }}"
162146 echo "Setting package.json version to: $BETA_VERSION"
163147 npm version --no-git-tag-version --allow-same-version "$BETA_VERSION"
164148
165149 - name : Verify version is set correctly
166150 run : |
167151 PACKAGE_VERSION=$(node -p "require('./package.json').version")
168- EXPECTED_VERSION="${{ needs.update_changelog_and_version .outputs.beta_version }}"
152+ EXPECTED_VERSION="${{ needs.calculate_beta_version .outputs.beta_version }}"
169153 if [ "$PACKAGE_VERSION" != "$EXPECTED_VERSION" ]; then
170154 echo "Version mismatch! Package: $PACKAGE_VERSION, Expected: $EXPECTED_VERSION"
171155 exit 1
0 commit comments