Skip to content

Create new diff in discussions #23

Create new diff in discussions

Create new diff in discussions #23

Workflow file for this run

name: Create new diff in discussions
on:
workflow_dispatch:
inputs:
ff-diff-version:
description: "ff-diff version"
required: false
old-version:
description: "Old version"
required: true
new-version:
description: "New version"
required: true
permissions:
discussions: write
jobs:
create-discussion:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
ref: ${{ github.event.inputs.ff-diff-version }}
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
run_install: false
- name: Install latest node LTS
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: "package.json"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run ff-diff
env:
OLD_VERSION: ${{ github.event.inputs.old-version }}
NEW_VERSION: ${{ github.event.inputs.new-version }}
run: |
pnpm run ff-diff diff "${OLD_VERSION}" "${NEW_VERSION}" \
--do-not-print-in-console \
--hide-common-changed-values \
--save-output-in-file
- name: Create a new GitHub Discussion
uses: abirismyname/create-discussion@c2b7c825241769dda523865ae444a879f6bbd0e0 # v2.1.1
with:
title: Diffs ${{ github.event.inputs.old-version }}-${{ github.event.inputs.new-version }}
body-filepath: .ff-diff/diffs/${{ github.event.inputs.old-version }}-${{ github.event.inputs.new-version }}.md
category-name: Diffs
github-token: ${{ secrets.GITHUB_TOKEN }}