Skip to content

Create new diff in discussions #4

Create new diff in discussions

Create new diff in discussions #4

Workflow file for this run

name: Create new diff in discussions
on:
workflow_dispatch:
inputs:
version1:
description: "Old version"
required: true
version2:
description: "New version"
required: true
jobs:
create-discussion:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install latest node LTS
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: Run ff-diff
run: npm run ff-diff -- ${{ github.event.inputs.version1 }} ${{ github.event.inputs.version2 }} --save-diffs-in-file
- name: Read diff file into variable
id: read-diff
run: |
echo "body<<EOF" >> $GITHUB_OUTPUT
cat .diff/${{ github.event.inputs.version1 }}-${{ github.event.inputs.version2 }}.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create a new GitHub Discussion
uses: abirismyname/create-discussion@main
with:
title: Diffs ${{ github.event.inputs.version1 }}-${{ github.event.inputs.version2 }}
body: ${{ steps.read-diff.outputs.body }}
category-name: Diffs
github-token: ${{ secrets.GITHUB_TOKEN }}