Skip to content

Merge pull request #2716 from mizoR/fix-erb-newline-compensation-for-… #28

Merge pull request #2716 from mizoR/fix-erb-newline-compensation-for-…

Merge pull request #2716 from mizoR/fix-erb-newline-compensation-for-… #28

name: Publish Release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pull-requests: read
jobs:
publish:
name: Publish release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
actions: write
# Only run if this is a release commit created by script/release.
# Match either the direct commit message from script/release
# ("release X.Y.Z") or the merge-commit body containing the release
# PR title ("Release X.Y.Z"), so a normal PR merge still triggers.
# Also always run on manual workflow_dispatch.
if: |
github.event_name == 'workflow_dispatch' ||
startsWith(github.event.head_commit.message, 'release ') ||
contains(github.event.head_commit.message, 'Release ')
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- name: Set up Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b
with:
ruby-version: 4.0
bundler-cache: true
- name: Harden runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c
with:
egress-policy: audit
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
script/publish