Skip to content

TDIFF (MAIN)

TDIFF (MAIN) #2

Workflow file for this run

name: TDIFF (MAIN)
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
branches:
- main # only run on PRs targetting main
paths:
- 'packages/tokens/src/**' # only run when files in these paths change
jobs:
generate-report:
runs-on: ubuntu-latest
name: Generate token diff report
steps:
- run: echo "🎉 The '${{ github.workflow }}' was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🔎 The name of your branch is head=${{ github.head_ref }} and base=${{ github.base_ref }} and your repository is ${{ github.repository }}."
- name: GET BRANCH NAME
shell: bash
run: echo "branch=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | sed -r 's/[\/]+/--/g')" >> $GITHUB_OUTPUT
id: extract_branch
- name: CHECKOUT TDIFF from ${{ github.repository }}/main
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
path: spectrum-tokens
ref: main
- name: CHANGE DIRECTORY
run: cd tools/diff-generator
- name: SETUP NODE
uses: actions/setup-node@v4
with:
node-version: '20.17.0'
- name: NPM INSTALL
run: npm INSTALL
- name: CREATE REPORT
run: |
node src/lib/cli.js report -otb main -ntb ${{ steps.extract_branch.outputs.branch }} --repo ${{ github.repository }} --format markdown --output logs/output.md
- name: ADD SUMMARY
run: |
cat ./logs/output.md >> $GITHUB_STEP_SUMMARY
- name: COMPLETE
run: echo "🍏 This job's status is ${{ job.status }}."