Skip to content

Commit

Permalink
Update README to use environment files instead of set-state
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuamcewen committed Jun 27, 2023
1 parent 71948d3 commit 1cd82fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This action is intended for validating version increments as part of CI. It does
## Example Usage

```yaml
uses: joshuamcewen/semver-check-action@1.0.0
uses: joshuamcewen/semver-check-action@1.0.1
with:
current-version: '0.0.1'
branch-version: '0.0.2'
Expand All @@ -22,17 +22,15 @@ with:
### Pulling from package.json
```yaml
- name: Get main version
id: main
run: |
git fetch origin main:main
echo "::set-output name=VERSION::$(git show main:package.json | jq -r ".version")"
echo "main_version=$(git show main:package.json | jq -r ".version")" >> "$GITHUB_ENV"
- name: Get current branch version
id: branch
run: echo "::set-output name=VERSION::$(jq -r ".version" package.json)"
run: echo "branch_version=$(jq -r ".version" package.json)" >> "$GITHUB_ENV"

- uses: joshuamcewen/semver-check-action@v1.0.0
- uses: joshuamcewen/semver-check-action@v1.0.1
with:
current-version: ${{ steps.main.outputs.VERSION }}
branch-version: ${{ steps.branch.outputs.VERSION }}
current-version: ${{ env.main_version }}
branch-version: ${{ env.branch_version }}
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "semver-check-action",
"main": "dist/index.js",
"version": "1.0.0",
"version": "1.0.1",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
Expand Down

0 comments on commit 1cd82fe

Please sign in to comment.