Skip to content

Commit

Permalink
Access output variables from outputs namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mukulmishra18 committed Dec 27, 2023
1 parent afd5736 commit 42b7482
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
package-json-version: ${{ steps.define-release-version.outputs.packageJsonVersion }}
package-json-version: ${{ steps.define-package-json-version.outputs.packageJsonVersion }}
full-release-version: ${{ fromJson(steps.define-release-version.outputs.result).full }}
steps:
- name: Read package.json version
Expand All @@ -30,7 +30,7 @@ jobs:
with:
script: |
const { defineReleaseVersion } = require('./.github/scripts/defineVersion.js')
return defineReleaseVersion({core}, "${{ inputs.release-type || 'minor' }}", "${{ inputs.prerelease-label }}", "${{ package-json-version }}" )
return defineReleaseVersion({core}, "${{ inputs.release-type || 'minor' }}", "${{ inputs.prerelease-label }}", "${{ outputs.package-json-version }}" )
- name: Checkout develop
uses: actions/checkout@v2
with:
Expand All @@ -39,7 +39,7 @@ jobs:
- name: Bump package.json version
run: |
git pull
RELEASE-VERSION=${{ full-release-version }}
RELEASE-VERSION=${{ outputs.full-release-version }}
npm version "${RELEASE-VERSION}"
- name: Update Changelog
uses: actions/github-script@v6
Expand All @@ -49,7 +49,7 @@ jobs:
const { execSync } = require('child_process');
const { updateChangeLog } = require('./.github/scripts/updateChangelog.js')
const stableVersion = '${{ full-release-version }}'.split('-')[0]
const stableVersion = '${{ outputs.full-release-version }}'.split('-')[0]
const releaseDate = new Date().toISOString().split('T')[0]
const data = fs.readFileSync('./CHANGELOG.md',{encoding:'utf8', flag:'r'});
Expand All @@ -65,15 +65,15 @@ jobs:
token: ${{ secrets.GH_TOKEN }}
run: |
git add .
git commit -m "Bump version ${{ full-release-version }} and update changelog"
git commit -m "Bump version ${{ outputs.full-release-version }} and update changelog"
git push --set-upstream origin develop
- name: Tag and push
uses: actions/github-script@v6
# Tag push should happen without a token, otherwise it will not trigger release workflow
with:
script: |
const { execSync } = require('child_process');
const { fullReleaseVersion } = ${{ full-release-version }}
const { fullReleaseVersion } = ${{ outputs.full-release-version }}
const tag = `v${fullReleaseVersion}`;
const message = `Release ${fullReleaseVersion}`;
Expand Down

0 comments on commit 42b7482

Please sign in to comment.