Skip to content

Commit

Permalink
ci(publish): add dynamic branch name logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcr committed Mar 29, 2024
1 parent 016aac5 commit cdf20a7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/auto-all-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,24 @@ jobs:
runs-on: windows-latest
outputs:
publishVersion: ${{ steps.parseTag.outputs.publishVersion }}
branchVersion: ${{ steps.parseTag.outputs.branchVersion }}
steps:
- name: CheckOut Code
uses: actions/checkout@master
with:
ref: dev

- name: Parse Tag
id: parseTag
uses: actions/github-script@v6
with:
script: |
const tag = `${{ github.ref_name }}`
const publishVersion = tag.slice(3)
const branchVersion = tag.slice(1)
core.setOutput('publishVersion', publishVersion)
core.setOutput('branchVersion', branchVersion)
- name: CheckOut Code
uses: actions/checkout@master
with:
ref: release-${{ steps.parseTag.outputs.branchVersion }}

- name: Setup pnpm
uses: pnpm/action-setup@v2

Expand Down

0 comments on commit cdf20a7

Please sign in to comment.