Skip to content

Commit

Permalink
ci: set output has been updated to use GITHUB_OUTPUT #1726 (#1727)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukasz Gornicki <[email protected]>
  • Loading branch information
SumantxD and derberg authored Jun 22, 2023
1 parent 86ffbb2 commit 8e441e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lighthouse-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
)
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
run: echo "shouldrun=true" >> $GITHUB_OUTPUT
- if: steps.should_run.outputs.shouldrun == 'true'
uses: actions/checkout@v3
Expand Down
11 changes: 9 additions & 2 deletions pages/blog/automated-releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ To share the output, you must assign an `id` to the step and declare a variable
```yaml
- name: Get version from package.json after release step
id: extractver
run: echo "::set-output name=version::$(npm run get-version --silent)"
run: |
version=$(npm run get-version --silent)
echo "version=$version" >> $GITHUB_OUTPUT
```
You can access the shared value by the `id` and a variable name like `steps.extractver.outputs.version`. We use it, for example, in the condition that specifies if further steps of the workflow should be triggered or not. If the version in `package.json` changed after GitHub and NPM step, this means we should proceed with Docker publishing and pull request creation:
Expand Down Expand Up @@ -228,9 +230,14 @@ jobs:
node-version: 13
- name: Install dependencies
run: npm ci
- name: Get version from package.json before release step
id: initversion
run: echo "::set-output name=version::$(npm run get-version --silent)"
run: npm run get-version --silent
- name: Set output
run: echo "version=$(npm run get-version --silent)" >> $GITHUB_OUTPUT
- name: Release to NPM and GitHub
id: release
env:
Expand Down

0 comments on commit 8e441e2

Please sign in to comment.