Skip to content

Commit cb4d8e8

Browse files
committed
Pass variables via outputs
1 parent 56748aa commit cb4d8e8

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.github/workflows/actions.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ jobs:
2121
cd "$GITHUB_WORKSPACE"
2222
- name: Check if version on pubspec.yaml was changed and if there's an entry for this new version on CHANGELOG
2323
run: |
24-
cat "${GITHUB_EVENT_PATH}" || true
2524
git fetch --prune --unshallow
26-
git diff head~1 || true
2725
2826
if test "${{ github.ref }}" = "refs/heads/master"; then
2927
where=HEAD~$(gojq '.commits | length' "${GITHUB_EVENT_PATH}")
@@ -49,24 +47,27 @@ jobs:
4947
runs-on: ubuntu-latest
5048
if: contains(github.ref, 'master')
5149
steps:
50+
- uses: actions/checkout@master
5251
- uses: actions/download-artifact@v1
5352
with:
5453
name: package_data
55-
- run: echo "::set-env name=PACKAGE_VERSION::v$(cat package_data/version)"
56-
- run: echo "::set-env name=CHANGELOG::v$(cat package_data/changelog)"
54+
- id: vars
55+
run: |
56+
echo "::set-output name=package_version::v$(cat package_data/version)"
57+
echo "::set-output name=changelog::$(cat package_data/changelog)"
5758
- name: Push tag
5859
uses: anothrNick/github-tag-action@master
5960
env:
6061
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
CUSTOM_TAG: ${{ env.PACKAGE_VERSION }}
62+
CUSTOM_TAG: ${{ steps.vars.outputs.package_version }}
6263
- name: Create release
6364
uses: actions/create-release@v1
6465
env:
6566
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6667
with:
67-
tag_name: ${{ env.PACKAGE_VERSION }}
68-
release_name: Release ${{ env.PACKAGE_VERSION }}
69-
body: ${{ env.CHANGELOG }}
68+
tag_name: ${{ steps.vars.outputs.package_version }}
69+
release_name: Release ${{ steps.vars.outputs.package_version }}
70+
body: ${{ steps.vars.outputs.changelog }}
7071
deploy:
7172
needs: create-tag-and-release
7273
runs-on: ubuntu-latest

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CHANGELOG
22

3-
## 0.2.0+7
3+
## 0.2.0+8
44
- Testing GitHub actions
55

66
## 0.2.0

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: fuzzy
2-
version: 0.2.0+7
2+
version: 0.2.0+8
33

44
authors:
55
- Igor Borges <[email protected]>

0 commit comments

Comments
 (0)