Skip to content

Commit

Permalink
ci(.github/workflows/worker.yml): add job summary
Browse files Browse the repository at this point in the history
  • Loading branch information
risu729 committed Jan 11, 2025
1 parent c321afd commit fe27525
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
worker/*
sparse-checkout-cone-mode: false
persist-credentials: false
# set fetch-depth to 2 for pull requests to get the head commit, not only the merge commit
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 1 }}

- name: Install mise
uses: jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
Expand Down Expand Up @@ -107,6 +109,19 @@ jobs:
apiToken: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}

- name: Generate Job Summary
if: ${{ !cancelled() }}
run: |
worker_name=$(echo "${{ steps.deploy.outputs.command-output }}" \
| grep --only-matching --perl-regexp '^Uploaded \K[^ ]+')
version_id=$(echo "${{ steps.deploy.outputs.command-output }}" \
| grep --only-matching --perl-regexp '^Worker Version ID: \K.+')
preview_url=$(echo "${{ steps.deploy.outputs.command-output }}" \
| grep --only-matching --perl-regexp '^Version Preview URL: \K.+')
echo "# ${worker_name}
- Version ID: ${version_id}
- Preview URL: ${preview_url}" >> "${GITHUB_STEP_SUMMARY}"
actions-timeline:
needs:
- deploy-worker
Expand Down

0 comments on commit fe27525

Please sign in to comment.