2023-05-16 01:13:31 +00:00
|
|
|
name: 'Changelog Auto Add'
|
2023-06-26 22:07:47 +00:00
|
|
|
on:
|
2023-07-20 00:38:39 +00:00
|
|
|
pull_request_target:
|
2023-06-26 22:07:47 +00:00
|
|
|
types: [opened, synchronize, reopened, edited]
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
prNumber:
|
|
|
|
description: Pull request number
|
|
|
|
required: true
|
2023-05-16 01:13:31 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-06-26 22:07:47 +00:00
|
|
|
add-changelog:
|
|
|
|
name: 'Add changelog to PR'
|
|
|
|
if: ${{ github.event.pull_request.user.login != 'github-actions[bot]' }}
|
2023-05-16 01:13:31 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2023-06-26 22:07:47 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
issues: write
|
|
|
|
pull-requests: write
|
2023-05-16 01:13:31 +00:00
|
|
|
steps:
|
2023-06-26 22:07:47 +00:00
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup PNPM
|
|
|
|
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
|
|
|
|
with:
|
2023-07-18 02:27:18 +00:00
|
|
|
version: '8.6.7'
|
2023-06-26 22:07:47 +00:00
|
|
|
|
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
|
|
|
|
with:
|
|
|
|
node-version-file: .nvmrc
|
|
|
|
cache: pnpm
|
|
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
|
|
|
|
- name: Install prerequisites
|
|
|
|
run: |
|
|
|
|
pnpm install --filter monorepo-utils --ignore-scripts
|
|
|
|
# ignore scripts speeds up setup signficantly, but we still need to build monorepo utils
|
|
|
|
pnpm build
|
|
|
|
working-directory: tools/monorepo-utils
|
|
|
|
|
|
|
|
- name: Add changelog
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: pnpm utils changefile ${{github.event.number || inputs.prNumber}} -o ${{ github.repository_owner }}
|