Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: resolve ref in release-final across different triggers #8713

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .github/workflows/release-final.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ jobs:
env:
NODE_OPTIONS: "--max-old-space-size=7168"
steps:
- name: Set resolved_ref
id: set-resolved-ref
run: |
if [ "${{ inputs.ref }}" ]; then
echo "resolved_ref=${{ inputs.ref }}" >> $GITHUB_ENV
else
if ${{ contains(github.event.workflow_run.name, '(Hotfix)') }}; then
echo "resolved_ref=hotfix" >> $GITHUB_ENV
else
echo "resolved_ref=main" >> $GITHUB_ENV
fi
fi
shell: bash
- name: generate token
id: generate-token
uses: tibdex/github-app-token@v1
Expand All @@ -39,7 +52,7 @@ jobs:
private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
ref: ${{ env.resolved_ref }}
fetch-depth: 2
token: ${{ steps.generate-token.outputs.token }}
- name: Setup git user
Expand Down Expand Up @@ -118,7 +131,7 @@ jobs:
git tag live-mobile@${{ steps.mobile-version.outputs.version }}
- name: push changes
run: |
git push origin ${{ inputs.ref }} --tags
git push origin ${{ env.resolved_ref }} --tags
- name: create desktop github release
if: ${{ steps.desktop-changed.outputs.status != 0 || github.event_name == 'workflow_dispatch' && contains(fromJson('["LLD", "ALL"]'), inputs.app) }}
env:
Expand All @@ -143,7 +156,7 @@ jobs:
ref: "main",
workflow_id: "release-desktop.yml",
inputs: {
branch: "${{ inputs.ref }}"
branch: "${{ env.resolved_ref }}"
}
});
- uses: actions/github-script@v7
Expand All @@ -158,6 +171,6 @@ jobs:
ref: "main",
workflow_id: "release-mobile.yml",
inputs: {
ref: "${{ inputs.ref }}"
ref: "${{ env.resolved_ref }}"
}
});
Loading