Skip to content

feat: adding support for syslog facility (#94) #70

feat: adding support for syslog facility (#94)

feat: adding support for syslog facility (#94) #70

Workflow file for this run

name: Release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
issues: write
pull-requests: write
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
token: ${{ secrets.PAT_TOKEN }}
- name: Detect logging.sh changes since last tag
id: logging_change
run: |
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || true)
# No tags yet → allow release (first release)
if [ -z "$LAST_TAG" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
# Manual workflow_dispatch: create patch bump commit
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "Manual trigger detected; creating patch bump commit"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit --allow-empty -m "fix: trigger manual patch release [skip ci]"
# Set up credentials for push
git remote set-url origin https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}
git push origin main
echo "changed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
# Auto push: only release if logging.sh changed
if git diff --name-only "$LAST_TAG"..HEAD -- logging.sh | grep -q .; then
echo "logging.sh changed since $LAST_TAG"
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "No logging.sh changes since $LAST_TAG; skipping release."
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Setup Node.js
if: steps.logging_change.outputs.changed == 'true'
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
- name: Install dependencies
if: steps.logging_change.outputs.changed == 'true'
run: |
npm install -g \
semantic-release@24 \
@semantic-release/changelog@6 \
@semantic-release/git@10 \
@semantic-release/exec@6 \
conventional-changelog-conventionalcommits@8
- name: Verify dependencies
if: steps.logging_change.outputs.changed == 'true'
run: |
echo "Node version: $(node --version)"
echo "npm version: $(npm --version)"
semantic-release --version
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
if: steps.logging_change.outputs.changed == 'true'
run: npx semantic-release