fix: Change action name #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Generate JavaScript code and open pull request with it' | |
on: | |
push: | |
branches-ignore: | |
- 'renovate/*' | |
- 'github-actions/generate-js/*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
- run: npm install | |
- run: npm run prepare | |
- name: Get word diff to see changes in dist folder | |
id: diff | |
run: | | |
if ! git diff --quiet dist | |
then | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "GIT_DIFF<<$EOF" >> $GITHUB_OUTPUT | |
git diff --word-diff=porcelain --word-diff-regex=. dist | grep '^[+-]' >> $GITHUB_OUTPUT | |
echo "$EOF" >> $GITHUB_OUTPUT | |
fi | |
- name: Create pull request with generated JavaScript | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
add-paths: dist/ | |
commit-message: Generate JavaScript based on ${{ github.sha }} | |
author: GitHub <[email protected]> | |
branch: github-actions/generate-js/${{ github.ref_name }} | |
title: Generate JavaScript for branch `${{ github.ref_name }}` | |
body: | | |
This pull pequest is opened automatically and contains generated JavaScript code based on commit ${{ github.sha }}. The changes are the following (context excluded): | |
``` | |
${{ steps.diff.outputs.GIT_DIFF }} | |
``` |