Skip to content

Commit

Permalink
count published crates
Browse files Browse the repository at this point in the history
  • Loading branch information
boozook committed Feb 10, 2024
1 parent d81a196 commit 732c4e7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,20 @@ jobs:
ignore-unpublished-changes: ${{ github.head_ref == 'false' }}
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

- name: Pre Post
if: fromJSON(steps.publisher.outputs.published).*
- name: Count published
id: counter
if: (github.event.inputs.dry-run == 'true' || (github.head_ref && 'true') || 'false') == 'false'
env:
CRATES: ${{ steps.publisher.outputs.published }}
run: |
echo "$CRATES"
CRATES_NUM=$(echo $CRATES | jq '. | length')
echo "value=$CRATES_NUM" >> "$GITHUB_OUTPUT"
LIST="${{ join(fromJSON(steps.publisher.outputs.published).*.name, ', ') }}"
echo "Published crates: $LIST"
echo "Published $CRATES_NUM crates: $LIST"
- name: Post
if: fromJSON(steps.publisher.outputs.published).* && (github.event.inputs.dry-run == 'true' || (github.head_ref && 'true'))
uses: ./.github/workflows/post.yml
with:
message: Crate${{ fromJSON(steps.publisher.outputs.published)[1] && 's' || '' }} ${{ join(fromJSON(steps.publisher.outputs.published).*.name, ', ') }} updated on crates io.
message: Crate${{ steps.counter.outputs.value == 1 && '' || 's' }} ${{ join(fromJSON(steps.publisher.outputs.published).*.name, ', ') }} updated.

0 comments on commit 732c4e7

Please sign in to comment.