Skip to content

Commit 3e1a5bf

Browse files
committed
use env to pass input and output parameters
1 parent 898d9fd commit 3e1a5bf

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.github/workflows/bump.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,42 @@ jobs:
2525
id: bump_version
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
NEW_VERSION: ${{ github.event.inputs.new_version }}
29+
CHANGELOG: ${{ github.event.inputs.changelog }}
2830
run: |
2931
old_version=$(sed -e 's/.*=//' version.properties)
30-
echo "Bumping old version: $old_version to new version ${{ github.event.inputs.new_version }}."
32+
echo "Bumping old version: $old_version to new version $NEW_VERSION."
3133
echo "Changelog:"
32-
echo "- ${{ github.event.inputs.changelog }}"
34+
echo "- $CHANGELOG"
3335
34-
echo "# ${{ github.event.inputs.new_version }}" >> new_CHANGELOG.md
36+
echo "# $NEW_VERSION" >> new_CHANGELOG.md
3537
echo >> new_CHANGELOG.md
36-
echo "- ${{ github.event.inputs.changelog }}" >> new_CHANGELOG.md
38+
echo "- $CHANGELOG" >> new_CHANGELOG.md
3739
echo >> new_CHANGELOG.md
3840
cat CHANGELOG.md >> new_CHANGELOG.md
3941
mv new_CHANGELOG.md CHANGELOG.md
4042
41-
sed -i -e "s/$old_version/${{ github.event.inputs.new_version }}/" version.properties README.md
43+
sed -i -e "s/$old_version/$NEW_VERSION/" version.properties README.md
4244
43-
echo "version=${{ github.event.inputs.new_version }}" > version.properties
45+
echo "version=$NEW_VERSION" > version.properties
4446
4547
git diff
4648
4749
git config --global user.name "${GITHUB_USER:-Automated Version Bump}"
4850
git config --global user.email "${GITHUB_EMAIL:[email protected]}"
4951
5052
git add --all
51-
git commit -m "Prep for releasing version ${{ github.event.inputs.new_version }}."
53+
git commit -m "Prep for releasing version $NEW_VERSION."
5254
5355
git log -n 1
5456
55-
git tag "v${{ github.event.inputs.new_version }}"
57+
git tag "v$NEW_VERSION"
5658
remote="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
5759
5860
git push "${remote}" --follow-tags
5961
git push "${remote}" --tags
6062
61-
echo "::set-output name=new_tag::v${{ github.event.inputs.new_version }}"
63+
echo "::set-output name=new_tag::v$NEW_VERSION"
6264
6365
- name: Create release
6466
id: create_release

.github/workflows/check.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
run: echo "::set-output name=matrix::$(cat plugin/build/build-resources/androidTestTasks.json)"
3131

3232
- name: debug
33-
run: echo ${{ steps.setup-matrix.outputs.matrix }}
33+
env:
34+
MATRIX: ${{ steps.setup-matrix.outputs.matrix }}
35+
run: echo $MATRIX
3436

3537
outputs:
3638
matrix: ${{ steps.setup-matrix.outputs.matrix }}

0 commit comments

Comments
 (0)