Skip to content

feat: add workflow dispatch for cd runs #5

feat: add workflow dispatch for cd runs

feat: add workflow dispatch for cd runs #5

Workflow file for this run

name: CI
on:
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/test
sync-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Sync package.json version
id: version-sync
run: |
ELM_VERSION=$(jq -r '.version' elm.json)
PKG_VERSION=$(jq -r '.version' package.json)
if [ "$ELM_VERSION" != "$PKG_VERSION" ]; then
pnpm version "$ELM_VERSION" --no-git-tag-version
echo "synced=true" >> $GITHUB_OUTPUT
else
echo "synced=false" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Commit version sync
if: steps.version-sync.outputs.synced == 'true'
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: chore: sync package.json version with elm.json

Check failure on line 46 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 46
file_pattern: package.json pnpm-lock.yaml
branch: ${{ github.head_ref }}
check-publishable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
- run: pnpm install
shell: bash
- name: Check if publishable
id: publish
uses: ./.github/actions/publish
with:
dry-run: true
github-token: ''
- name: Fail if not publishable
if: steps.publish.outputs.is-publishable != 'true'
run: |
echo "::error::Version in elm.json is already published or invalid. Run 'elm bump' to update it."
exit 1
shell: bash