Repository navigation
60 lines (53 loc) · 1.64 KB
/
Copy pathcreate-blog-post.yml
File metadata and controls
60 lines (53 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Create Blog Post
on:
workflow_call:
inputs:
tag:
description: 'Release tag (e.g. v5.99.0)'
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: 'Release tag (e.g. v5.99.0)'
required: true
type: string
permissions:
contents: write
pull-requests: write
jobs:
create-post:
runs-on: ubuntu-latest
env:
TAG: ${{ inputs.tag }}
AUTHOR: ${{ github.actor }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: lts/*
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Create post
shell: bash
run: |
set -euo pipefail
node scripts/release/create-post.mjs "$TAG" --author="$AUTHOR"
node --run format
- name: Open pull request
uses: gr2m/create-or-update-pull-request-action@b65137ca591da0b9f43bad7b24df13050ea45d1b # v1.10.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit-message: 'chore: blog post for webpack@${{ env.TAG }}'
title: 'chore: blog post for webpack@${{ env.TAG }}'
body: |
Automated blog post by the `${{ env.TAG }}` webpack release.
branch: 'chore/blog-${{ env.TAG }}'
author: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'
draft: true