Skip to content

Commit

Permalink
Fix prerelease depth output in workflow (#3)
Browse files Browse the repository at this point in the history
* maybe

* maybe 2

* maybe 3

* accidental powershell

* smol cleanup
  • Loading branch information
Confusingboat authored Jun 2, 2023
1 parent cfb92cb commit 4f71e7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
needs:
- tag
- build_and_test
if: ${{ github.event_name != 'pull_request' && needs.tag.outputs.prerelease == '' || needs.tag.outputs.prerelease-depth == '1' }}
if: ${{ github.event_name != 'pull_request' && needs.tag.outputs.prerelease-depth < 2 }}
uses: ./.github/workflows/release.yml
with:
version: ${{ needs.tag.outputs.version }}
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true

defaults:
run:
shell: pwsh

jobs:
tag:
runs-on: ubuntu-latest
Expand All @@ -40,7 +36,7 @@ jobs:
minor: ${{ steps.version.outputs.minor }}
patch: ${{ steps.version.outputs.patch }}
prerelease: ${{ steps.version.outputs.prerelease }}
prerelease-depth: ${{ steps.determine-releasability.outputs.pre-release-depth }}
prerelease-depth: ${{ steps.get-prerelease-depth.outputs.prerelease_depth }}
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -61,10 +57,12 @@ jobs:
echo major: ${{ steps.version.outputs.major }}, minor: ${{ steps.version.outputs.minor }}, patch: ${{ steps.version.outputs.patch }}
echo prerelease: ${{ steps.version.outputs.prerelease }}
- name: determine releasability
id: determine-releasability
- name: get prerelease depth
id: get-prerelease-depth
run: |
echo "prerelease-depth=$(echo '${{ steps.version.outputs.prerelease }}' | tr -cd '.' | wc -c | tr -d ' ')" >> "$GITHUB_OUTPUT"
echo "prerelease_depth=$(echo '${{ steps.version.outputs.prerelease }}' | tr -cd '.' | wc -c | tr -d ' ')" >> "$GITHUB_OUTPUT"
- run: echo "${{ steps.get-prerelease-depth.outputs.prerelease_depth }}"

# - run: |
# git tag v${{ steps.version.outputs.version }}
Expand All @@ -85,6 +83,4 @@ jobs:
# - name: Version tag
# uses: EndBug/[email protected]
# with:
# ref: v${{ steps.version.outputs.version }}

# Let's pretend this was a meaningful change
# ref: v${{ steps.version.outputs.version }}

0 comments on commit 4f71e7b

Please sign in to comment.