我有一个在发布事件上发布 nuget 包的工作流程,但我无法从标记名中删除“v”字符。我所有的标签名称都是 v${version} 所以我需要删除该“v”并仅获取版本。
我的工作流程是这样的:
name: Nuget package publish
on:
release:
types: [published]
jobs:
nuget:
name: Nuget - Publish package
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: Set VERSION variable from tag
run: |
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
echo "VERSION=${VERSION:1}" >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration …Run Code Online (Sandbox Code Playgroud)