mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-11 03:06:54 +00:00
b0807fbb5e
Bumps the all-actions group with 4 updates in the / directory: [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action), [actions/download-artifact](https://github.com/actions/download-artifact), [actions/create-github-app-token](https://github.com/actions/create-github-app-token) and [googleapis/release-please-action](https://github.com/googleapis/release-please-action). Updates `aquasecurity/trivy-action` from 0.35.0 to 0.36.0 - [Release notes](https://github.com/aquasecurity/trivy-action/releases) - [Commits](https://github.com/aquasecurity/trivy-action/compare/57a97c7e7821a5776cebc9bb87c984fa69cba8f1...ed142fd0673e97e23eac54620cfb913e5ce36c25) Updates `actions/download-artifact` from 7 to 8 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v7...v8) Updates `actions/create-github-app-token` from 3.0.0 to 3.1.1 - [Release notes](https://github.com/actions/create-github-app-token/releases) - [Commits](https://github.com/actions/create-github-app-token/compare/f8d387b68d61c58ab83c6c016672934102569859...1b10c78c7865c340bc4f6099eb2f838309f1e8c3) Updates `googleapis/release-please-action` from 4.4.0 to 4.4.1 - [Release notes](https://github.com/googleapis/release-please-action/releases) - [Changelog](https://github.com/googleapis/release-please-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/release-please-action/compare/16a9c90856f42705d54a6fda1823352bdc62cf38...5c625bfb5d1ff62eadeeb3772007f7f66fdcf071) --- updated-dependencies: - dependency-name: aquasecurity/trivy-action dependency-version: 0.36.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-actions - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: actions/create-github-app-token dependency-version: 3.1.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-actions - dependency-name: googleapis/release-please-action dependency-version: 4.4.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
123 lines
4.2 KiB
YAML
123 lines
4.2 KiB
YAML
name: Release Blog Scaffold
|
|
|
|
# Fires on every v* tag push. Computes whether this tag completes the next
|
|
# every-5th-release window (source of truth = the latest release post's
|
|
# `version` field in the sencho-website repo). If yes, opens a DRAFT PR in
|
|
# sencho-website containing a pre-filled blog post scaffold; a human writes
|
|
# the narrative, adds the screenshot, and marks the PR ready.
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Tag to scaffold against (e.g. v0.58.0). Must already exist.'
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
scaffold:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
# Same App-token pattern as release-please.yml. The app's installation
|
|
# must include both Sencho and sencho-website for the push + PR to work.
|
|
- name: Generate GitHub App installation token
|
|
id: app-token
|
|
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
|
|
with:
|
|
app-id: ${{ secrets.APP_ID }}
|
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
owner: ${{ github.repository_owner }}
|
|
repositories: |
|
|
Sencho
|
|
sencho-website
|
|
permission-contents: write
|
|
permission-pull-requests: write
|
|
|
|
- name: Resolve target tag
|
|
id: target
|
|
run: |
|
|
set -euo pipefail
|
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
tag="${{ inputs.tag }}"
|
|
else
|
|
tag="${GITHUB_REF_NAME}"
|
|
fi
|
|
echo "tag=${tag}" >> "$GITHUB_OUTPUT"
|
|
echo "Resolved target tag: ${tag}"
|
|
|
|
- name: Check out Sencho (full history for tags)
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Check out sencho-website
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: ${{ github.repository_owner }}/sencho-website
|
|
token: ${{ steps.app-token.outputs.token }}
|
|
path: website-repo
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Run scaffold script
|
|
id: scaffold
|
|
run: |
|
|
set -euo pipefail
|
|
node .github/scripts/scaffold-release-post.mjs \
|
|
--tag "${{ steps.target.outputs.tag }}" \
|
|
--changelog CHANGELOG.md \
|
|
--website website-repo
|
|
|
|
- name: Commit and open draft PR in sencho-website
|
|
if: steps.scaffold.outputs.scaffold == 'true'
|
|
env:
|
|
GH_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
TAG: ${{ steps.target.outputs.tag }}
|
|
BRANCH: ${{ steps.scaffold.outputs.branch }}
|
|
POST_PATH: ${{ steps.scaffold.outputs.post_path }}
|
|
BODY_FILE: ${{ steps.scaffold.outputs.body_file }}
|
|
OWNER: ${{ github.repository_owner }}
|
|
run: |
|
|
set -euo pipefail
|
|
cd website-repo
|
|
# Short-circuit if a scaffold PR for this branch already exists (e.g.,
|
|
# a manual workflow_dispatch retry against the same tag).
|
|
existing=$(gh pr list \
|
|
--repo "${OWNER}/sencho-website" \
|
|
--head "${BRANCH}" \
|
|
--state open \
|
|
--json number --jq '.[0].number // empty')
|
|
if [ -n "${existing}" ]; then
|
|
echo "PR already exists for ${BRANCH} (#${existing}); nothing to do."
|
|
exit 0
|
|
fi
|
|
git config user.name "sencho-release-bot[bot]"
|
|
git config user.email "sencho-release-bot[bot]@users.noreply.github.com"
|
|
git checkout -B "${BRANCH}"
|
|
git add "${POST_PATH}" src/data/blog/index.ts
|
|
git commit -m "chore: scaffold release post for ${TAG}"
|
|
git push -u origin "${BRANCH}" --force-with-lease
|
|
gh pr create \
|
|
--repo "${OWNER}/sencho-website" \
|
|
--base main \
|
|
--head "${BRANCH}" \
|
|
--title "chore: scaffold release post for ${TAG}" \
|
|
--body-file "${BODY_FILE}" \
|
|
--draft
|
|
|
|
- name: Report skip
|
|
if: steps.scaffold.outputs.scaffold != 'true'
|
|
run: |
|
|
echo "No scaffold this run. Window did not reach the next every-5th-release anchor."
|