Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Commit 29d05a7

Browse files
fix(failing-automated-release): fixed the failing action of automatic release (#150)
* temporary change release.yaml directory * revery directory change * add echo commands * fix indentation * remove curly braces from the if conditions * change order of attributes in automated_release file * update variable name * fix error related to needs * changed line number for environment * remove environment attribute * test env fix * test release as getting permission error * fix syntax error * another if condition * revert release.yaml * fix version number and renamed a job * trying another approach * try env attribute in root * comment trigger_workflow step * remove unused lines * update variable name
1 parent 305aca7 commit 29d05a7

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

.github/workflows/automated_release.yaml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,25 @@ jobs:
1212
confirm-action-execution:
1313
runs-on: ubuntu-latest
1414
outputs:
15-
is_release_allowed: ${{ steps.is_release_allowed_check.outputs.is_release_allowed }}
15+
week_number_check: ${{ steps.week_number_check_step.outputs.week_number_check }}
16+
is_release_allowed: ${{ env.allow_automated_release }}
1617
environment:
1718
name: automated-release
1819
steps:
1920
- name: Confirm action execution
20-
id: is_release_allowed_check
21+
id: week_number_check_step
2122
run: |
2223
if (( $(date +%V) % 2 == 0 )); then
23-
echo "is_release_allowed=true" >> $GITHUB_OUTPUT
24+
echo "week_number_check=true" >> $GITHUB_OUTPUT
2425
else
25-
echo "is_release_allowed=false" >> $GITHUB_OUTPUT
26+
echo "week_number_check=false" >> $GITHUB_OUTPUT
2627
fi
2728
shell: bash
2829

29-
release:
30+
next-version:
3031
runs-on: ubuntu-latest
32+
outputs:
33+
next_version_number: ${{ steps.next_version_step.outputs.version }}
3134
needs: [confirm-action-execution]
3235
environment:
3336
name: automated-release
@@ -38,7 +41,7 @@ jobs:
3841
token: ${{ secrets.GITHUB_TOKEN }}
3942

4043
- name: Get current release version and calculate next patch version
41-
id: next_version
44+
id: next_version_step
4245
run: |
4346
git fetch --tags
4447
CURRENT_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
@@ -47,11 +50,15 @@ jobs:
4750
4851
- name: Show the values of version
4952
run: |
50-
echo ${{ steps.next_version.outputs.version }}
51-
echo ${{ needs.confirm-action-execution.outputs.is_release_allowed }}
53+
echo "Next version is ${{ steps.next_version_step.outputs.version }}"
54+
echo "Week number check is ${{ needs.confirm-action-execution.outputs.week_number_check }}"
55+
echo "Allow automated release value is ${{ env.allow_automated_release }}"
5256
53-
- name: Trigger release workflow
54-
uses: ./.github/workflows/release.yaml
55-
if: ${{ env.allow_automated_release == 'true' && needs.confirm-action-execution.outputs.is_release_allowed == 'true' }}
56-
with:
57-
version: ${{ steps.next_version.outputs.version }}
57+
trigger-workflow:
58+
name: Trigger release workflow
59+
needs: [confirm-action-execution, next-version]
60+
if: needs.confirm-action-execution.outputs.week_number_check == 'true' && needs.confirm-action-execution.outputs.is_release_allowed == 'true'
61+
uses: ./.github/workflows/release.yaml
62+
with:
63+
version: ${{ needs.next-version.outputs.next_version_number }}
64+
secrets: inherit

0 commit comments

Comments
 (0)