Reconfigure Renovatebot for projen #146
Workflow file for this run
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: Renovate Post-Upgrade | |
on: | |
pull_request: | |
jobs: | |
post-upgrade: | |
runs-on: ubuntu-latest | |
if: ${{ github.actor == 'renovate[bot]' || github.actor == 'dependabot[bot]' }} | |
outputs: | |
has-changes: ${{ steps.git-changes.outputs.has-changes }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PNPM | |
uses: ./.github/actions/pnpm | |
- name: Apply ESLint fixes | |
run: pnpm eslint --fix . | |
- name: Update Jest snapshots | |
run: pnpm jest --updateSnapshot --passWithNoTests | |
- name: Apply projen changes | |
run: pnpx projen | |
- name: Create Beachball changes | |
run: | | |
pnpm beachball change \ | |
--message "chore(deps): ${{ github.event.pull_request.title }}" \ | |
--no-commit \ | |
--type patch \ | |
--yes | |
- name: Check for Git changes | |
id: git-changes | |
run: | | |
if [[ `git status --porcelain | wc -c` -ne '0' ]]; then | |
echo "has-changes=true" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Create patch | |
run: | | |
git add -A | |
git diff --cached > .diff.patch | |
- name: Upload diff | |
uses: actions/upload-artifact@v4 | |
if: ${{ steps.git-changes.outputs.has-changes }} | |
with: | |
name: diff | |
path: .diff.patch | |
commit-upgrade-changes: | |
runs-on: ubuntu-latest | |
if: ${{ needs.post-upgrade.outputs.has-changes }} | |
needs: [post-upgrade] | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Download diff | |
uses: actions/download-artifact@v4 | |
with: | |
name: diff | |
- name: Configure Git user | |
uses: ./.github/actions/github-action-bot-git-user | |
- name: Apply diff | |
run: | | |
git apply .diff.patch | |
git add . | |
git commit -m "chore(deps): Apply upgrade changes" | |
git push origin ${{ github.event.pull_request.head.ref }} |