This repository has been archived by the owner on Sep 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (86 loc) · 3.31 KB
/
upgrade.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: upgrade
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
- 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
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
- 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.PROJEN_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" workflow*
branch: github-actions/upgrade
title: "chore(deps): upgrade dependencies"
labels: auto-approve,auto-merge
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" workflow*
author: Automation <github-actions@github.com>
committer: Automation <github-actions@github.com>
- 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\",\"status\
\":\"completed\",\"conclusion\":\"${{ needs.upgrade.outputs.conclusion
}}\",\"output\":{\"title\":\"Created via the upgrade
workflow.\",\"summary\":\"Action run URL: https://github.com/${{
github.repository }}/actions/runs/${{ github.run_id }}\"}}'"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}