Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Freezor committed Jun 16, 2024
1 parent 746b179 commit cea77de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/draft-prerelease-on-pushed-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ jobs:
- name: Extract branch name
id: extract_branch
run: |
git fetch --all
$commitSHA = git rev-parse HEAD
$branch = git branch -r --contains $commitSHA | Select-String -Pattern 'origin/' | Select-Object -First 1 | ForEach-Object { $_.Line -replace '.*origin/', '' } | ForEach-Object { $_.Trim() }
$branch = '${{ github.ref }}' -replace 'refs/heads/', ''
echo "branch=$branch" >> $env:GITHUB_OUTPUT
Write-Host "The current branch is: $branch"
shell: pwsh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ jobs:
- name: Extract branch name
id: extract_branch
run: |
git fetch --all
$commitSHA = git rev-parse HEAD
$branch = git branch -r --contains $commitSHA | Select-String -Pattern 'origin/' | Select-Object -First 1 | ForEach-Object { $_.Line -replace '.*origin/', '' } | ForEach-Object { $_.Trim() }
$branch = '${{ github.ref }}' -replace 'refs/heads/', ''
echo "branch=$branch" >> $env:GITHUB_OUTPUT
Write-Host "The current branch is: $branch"
shell: pwsh
Expand Down Expand Up @@ -167,4 +165,4 @@ jobs:
with:
files: "artefacts/release/v${{ steps.generate_version_number.outputs.version }}/*.zip"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: "v${{ steps.generate_version_number.outputs.version }}"
release-tag: "v${{ steps.generate_version_number.outputs.version }}"
4 changes: 1 addition & 3 deletions .github/workflows/prerelease-on-merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ jobs:
- name: Extract branch name
id: extract_branch
run: |
git fetch --all
$commitSHA = git rev-parse HEAD
$branch = git branch -r --contains $commitSHA | Select-String -Pattern 'origin/' | Select-Object -First 1 | ForEach-Object { $_.Line -replace '.*origin/', '' } | ForEach-Object { $_.Trim() }
$branch = '${{ github.ref }}' -replace 'refs/heads/', ''
echo "branch=$branch" >> $env:GITHUB_OUTPUT
Write-Host "The current branch is: $branch"
shell: pwsh
Expand Down

0 comments on commit cea77de

Please sign in to comment.