woocommerce/.github/workflows/changelog-auto-add.yml

47 lines
1.6 KiB
YAML

name: 'Changelog Auto Add'
on:
pull_request_target:
types: [opened, synchronize, reopened, edited]
workflow_dispatch:
inputs:
prNumber:
description: Pull request number
required: true
jobs:
add-changelog:
name: 'Add changelog to PR'
if: ${{ github.event.pull_request.user.login != 'github-actions[bot]' }}
runs-on: ubuntu-20.04
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
with:
version: '8.6.7'
- 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 }}