⬆️ Update dependency @actions/http-client to v2.2.2 #308
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: 'Update dist folder' | |
on: | |
push: | |
branches-ignore: renovate/* | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
dist-changed: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install dependencies | |
run: | | |
npm install | |
- name: Package (update dist folder) | |
run: | | |
npm run update-dist | |
- name: Did dist folder changed? | |
run: | | |
EXIT_CODE=0 | |
git update-index --refresh dist/* && git diff-index --quiet HEAD dist || EXIT_CODE=$? | |
# Set environment variable | |
echo "EXIT_CODE_DIST_CHANGED=$EXIT_CODE" >> $GITHUB_ENV | |
- name: Create PR | |
if: ${{ env.EXIT_CODE_DIST_CHANGED == 1 }} | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
title: '🧹 Update dist folder' | |
commit-message: '🧹 Update dist folder' | |
add-paths: dist/ | |
- name: Automerge PR | |
if: ${{ env.EXIT_CODE_DIST_CHANGED == 1 }} | |
run: gh pr merge --merge --auto "${{ steps.cpr.outputs.pull-request-number }}" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |