Skip to content

upgrade-master

upgrade-master #1066

# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: upgrade-master
on:
workflow_dispatch: {}
schedule:
- cron: 0 0 * * *
jobs:
upgrade:
name: Upgrade
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
conclusion: ${{ steps.build.outputs.conclusion }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
- name: Set git identity
run: |-
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Upgrade dependencies
run: npx projen upgrade
- name: Build
id: build
run: npx projen build && echo "::set-output name=conclusion::success" || echo
"::set-output name=conclusion::failure"
- name: Create Patch
run: |-
git add .
git diff --patch --staged > .upgrade.tmp.patch
- name: Upload patch
uses: actions/upload-artifact@v2
with:
name: .upgrade.tmp.patch
path: .upgrade.tmp.patch
container:
image: jsii/superchain:1-buster-slim
pr:
name: Create Pull Request
needs: upgrade
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
- name: Set git identity
run: |-
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Download patch
uses: actions/download-artifact@v2
with:
name: .upgrade.tmp.patch
path: ${{ runner.temp }}
- name: Apply patch
run: '[ -s ${{ runner.temp }}/.upgrade.tmp.patch ] && git apply ${{ runner.temp
}}/.upgrade.tmp.patch || echo "Empty patch. Skipping."'
- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: >-
chore(deps): upgrade dependencies
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by projen via the "upgrade-master" workflow*
branch: github-actions/upgrade-master
title: "chore(deps): upgrade dependencies"
body: >-
Upgrades project dependencies. See details in [workflow run].
[Workflow Run]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
------
*Automatically created by projen via the "upgrade-master" workflow*
author: github-actions <github-actions@github.com>
committer: github-actions <github-actions@github.com>
signoff: true
- name: Update status check
if: steps.create-pr.outputs.pull-request-url != ''
run: "curl -i --fail -X POST -H \"Accept: application/vnd.github.v3+json\" -H
\"Authorization: token ${GITHUB_TOKEN}\"
https://api.github.com/repos/${{ github.repository }}/check-runs -d
'{\"name\":\"build\",\"head_sha\":\"github-actions/upgrade-master\",\
\"status\":\"completed\",\"conclusion\":\"${{
needs.upgrade.outputs.conclusion }}\",\"output\":{\"title\":\"Created
via the upgrade-master workflow.\",\"summary\":\"Action run URL:
https://github.com/${{ github.repository }}/actions/runs/${{
github.run_id }}\"}}'"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}