Skip to content

Commit fd66dae

Browse files
committed
refactor: update action to latest requirements
1 parent d952cc3 commit fd66dae

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

.github/workflows/prerelease_on_version_bump.yaml

+5-16
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,21 @@ jobs:
2222
echo "Error: There must be exactly one custom component directory." >&2
2323
exit 1
2424
fi
25-
DOMAIN=$(basename $(find custom_components/* -maxdepth 0 -type d))
26-
echo "::set-output name=domain::$DOMAIN"
25+
echo "DOMAIN=$(basename $(find custom_components/* -maxdepth 0 -type d))" >> $GITHUB_ENV
2726
2827
- name: Install JQ
2928
run: sudo apt-get install jq
3029

3130
- name: Extract version from current commit
3231
id: current_version
33-
run: |
34-
DOMAIN=${{ steps.detect_integration.outputs.domain }}
35-
VERSION=$(jq -r '.version' custom_components/$DOMAIN/manifest.json)
36-
echo "::set-output name=version::$VERSION"
32+
run: echo "CURRENT_VERSION=$(jq -r '.version' custom_components/$DOMAIN/manifest.json)" >> $GITHUB_ENV
3733

3834
- name: Extract version from previous commit
3935
id: previous_version
40-
run: |
41-
DOMAIN=${{ steps.detect_integration.outputs.domain }}
42-
PREV_VERSION=$(git show HEAD~:custom_components/$DOMAIN/manifest.json | jq -r '.version')
43-
echo "::set-output name=version::$PREV_VERSION"
44-
45-
- name: Check if version changed
46-
if: steps.current_version.outputs.version != steps.previous_version.outputs.version
47-
run: echo "Version changed."
36+
run: echo "PREVIOUS_VERSION=$(git show HEAD~:custom_components/$DOMAIN/manifest.json | jq -r '.version')" >> $GITHUB_ENV
4837

4938
- name: Create Tag
50-
if: steps.current_version.outputs.version != steps.previous_version.outputs.version
39+
if: ${{ env.CURRENT_VERSION != env.PREVIOUS_VERSION }}
5140
uses: actions/github-script@v7
5241
with:
5342
script: |
@@ -60,7 +49,7 @@ jobs:
6049
});
6150
6251
- name: Create Pre-release
63-
if: steps.current_version.outputs.version != steps.previous_version.outputs.version
52+
if: ${{ env.CURRENT_VERSION != env.PREVIOUS_VERSION }}
6453
uses: actions/github-script@v7
6554
with:
6655
script: |

0 commit comments

Comments
 (0)