I used to use the original Action and as of today I had an error about multiple tags being present.
build-and-deploy
ERROR: Too many build-number- refs in repository, found 7, expected only 1. Check your tags!
I could not see 7 references and because we only just started using build numbers I removed ALL build number tags and thought to start from scratch and updated to your current branch. So my jobs at the moment looks like this:
jobs: build-and-deploy: runs-on: windows-latest steps: - uses: actions/checkout@v3 - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: dotnet-version: ${{ env.DOTNET_CORE_VERSION }} - name: Restore run: dotnet restore "${{ env.WORKING_DIRECTORY }}" - name: Read Version File Content id: json_properties uses: ActionsTools/read-json-action@main with: file_path: "./VERSION.json" - name: Version File Content run: echo ${{ steps.json_properties.outputs.version }} - name: Generate Build Number uses: onyxmueller/build-tag-number@v1 with: token: ${{ secrets.github_token }} - name: Print New Build Number run: echo "Build number is ${env:BUILD_NUMBER}" - name: Build run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore -property:Version=${{ steps.json_properties.outputs.version }}.${env:BUILD_NUMBER}
And the debug output is this:
Generate Build Number
Run onyxmueller/build-tag-number@v1
Last build nr was 3.
Updating build counter to 4...
Successfully updated build number to 4
'build_number=4' >> $GITHUB_OUTPUT
Deleting 1 older build counters...
Deleted refs/tags/build-number-3
Print New Build Number
Run echo "Build number is ${env:build_number}"
Build number is
And my build fails as I use the build number and it is not present.
It seems that the number is generated but for some reason it is not stored on the BUILD_NUMBER specified as per your example usage. Also I still see all build tags (build-number-1, build-number-2, build-number-3) on my repo, which I believe is as expected. This was also the behaviour of the original Action.
I am definitely running the action on a windows environment (runs-on: windows-latest), and I did use to always have the Build_Number correctly outputted and and passed onto my build command. The environment has not changed. However I do not get the build number any longer stored in the parameter. The original Action did not have any commits since Nov 2020, so I cannot understand the change in behaviour.
Is there an issue with the Action or has Github changed something?
Thank you