-
Notifications
You must be signed in to change notification settings - Fork 11
61 lines (53 loc) · 2.11 KB
/
npm_update_latest_prefect.yaml
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
---
name: Update to latest Prefect Packages
on:
workflow_dispatch:
inputs:
package_name:
description: The name of the Prefect package to update
required: true
package_version:
description: The version of the Prefect package to update
required: true
permissions: {}
jobs:
update_prefect_packages:
runs-on: ubuntu-latest
permissions:
# required to write to the repo
contents: write
steps:
- uses: actions/checkout@v4
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: create branch for dependency version updates
run: git checkout -b "prefect-package-${{ inputs.package_name }}-${{ inputs.package_version }}-update"
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install Dependencies
run: npm ci
- name: Upgrade Package
run: |
npm i @${{ inputs.package_name }}@${{ inputs.package_version }} --save-exact
- name: Commit Package changes
run: |
git add .
git commit -m "Update @${{ inputs.package_name }} to version ${{ inputs.package_version }}"
git push --set-upstream origin "prefect-package-${{ inputs.package_name }}-${{ inputs.package_version }}-update"
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create Pull Request
run: |
git checkout "prefect-package-${{ inputs.package_name }}-${{ inputs.package_version }}-update"
gh pr create \
--base main \
--title "Update @${{ inputs.package_name }} to version ${{ inputs.package_version }}" \
--body "Update @${{ inputs.package_name }} to version ${{ inputs.package_version }}.
Release information can be found at https://github.com/${{ inputs.package_name }}/releases/tag/${{ inputs.package_version }}." \
--label maintenance
env:
GITHUB_TOKEN: ${{ secrets.UI_COMPONENTS_CONTENTS_PRS_RW }}