Skip to content

Commit e68ea2c

Browse files
committed
deploy: label versions with the commit subject only
A multi-line commit message made wrangler-action run each body line as a separate command after a successful deploy, failing the run.
1 parent 0a95865 commit e68ea2c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/deploy.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ jobs:
4141
- run: npm test
4242
- run: npm run check
4343
- run: npx vite build
44+
# The action runs every line of `command` as its own wrangler call, so
45+
# only the commit subject may go into the message, and never a quote.
46+
- id: commit
47+
run: echo "subject=$(git log -1 --pretty=%s | tr -d '"')" >> "$GITHUB_OUTPUT"
4448
- uses: cloudflare/wrangler-action@v3
4549
with:
4650
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
4751
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
4852
# Shown in the dashboard's version list: which commit, and which workflow run shipped it.
4953
command: >-
5054
deploy --tag "${{ github.sha }}"
51-
--message "${{ github.workflow }} #${{ github.run_number }}: ${{ github.event.head_commit.message || github.ref_name }}"
55+
--message "${{ github.workflow }} #${{ github.run_number }}: ${{ steps.commit.outputs.subject }}"

0 commit comments

Comments
 (0)