Skip to content

chore(workflow): create a GitHub action for dry running publish process #6

chore(workflow): create a GitHub action for dry running publish process

chore(workflow): create a GitHub action for dry running publish process #6

name: Dry Run Publish
on:
pull_request:
branches:
- main
paths:
- ".changeset/**"
jobs:
dry-run-publish:
name: Dry Run Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Setup Node & pnpm
uses: ./.github/actions/setup-pnpm
- name: Install Dependencies
run: pnpm install
- name: Debug Environment Variables
run: |
echo "GITHUB_REF_NAME: ${{ github.ref_name }}"
echo "GITHUB_HEAD_REF: ${{ github.head_ref }}"
echo "GITHUB_REF: ${{ github.ref }}"
echo "PR Branch Name: ${{ github.event.pull_request.head.ref }}"
- name: Output Summary
id: summary
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
with:
script: |
return `## Dry Run Publish Results
This workflow ran a dry-run of the publish process to detect potential release issues.
- **Branch:** \`${process.env.BRANCH_NAME}\`
- **Trigger:** Pull Request modifying \`main\`
- **Status:** Completed
`
- name: Post Summary
run: echo -e "${{ steps.summary.outputs.result }}" >> $GITHUB_STEP_SUMMARY