generated from kousaku-maron/react-component-ts-template
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (70 loc) · 2.35 KB
/
update-packages.yml
File metadata and controls
70 lines (70 loc) · 2.35 KB
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
name: Update Packages
env:
CI: true
on:
repository_dispatch:
types: [update-packages] # with client_payload.packages
workflow_dispatch:
inputs:
packages:
description: ''
required: true
default: ''
jobs:
update-packages:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup Node
uses: actions/setup-node@v1
with:
always-auth: true
node-version: 14.x
registry-url: 'https://npm.pkg.github.com'
scope: '@funii-inc'
- name: Restore Cache
uses: actions/cache@v2
with:
path: 'functions/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('functions/yarn.lock') }}
- name: Install
run: yarn
env:
NODE_AUTH_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Update packages by workflow_dispatch
if: ${{ github.event.inputs.packages != null }}
run: yarn upgrade ${{ github.event.inputs.packages }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Update packages by repository_dispatch
if: ${{ github.event.client_payload.packages != null }}
run: yarn upgrade ${{ github.event.client_payload.packages }} --latest
env:
NODE_AUTH_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Update patch version
run: yarn version --patch --no-commit-hooks --no-git-tag-version
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GIT_TOKEN }}
commit-message: 'Update packages'
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: feature/update-package
branch-suffix: timestamp
delete-branch: true
title: 'Update Packages by CI'
body: |
@${{ github.actor }}
```
${{ github.event.inputs.packages }}
${{ github.event.client_payload.packages }}
```
- name: Check Pull Request
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"