-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
163 lines (133 loc) · 4.73 KB
/
action.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: molt-action
description: >
Create pull requests to update dependencies in Deno projects with jsr.io/@molt
branding:
icon: 'refresh-cw'
color: 'gray-dark'
inputs:
author:
description: >
Author of the pull request in the format of `Display Name <[email protected]>`.
default: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
base:
description: >
Base branch to create the pull request against. Defaults to the branch
checked out in the workflow.
branch:
description: Head branch for the pull request.
default: molt-action
cache-key-suffix:
description: Suffix for the cache key (development purposes only).
default: 1.0.2
commit:
description: Whether to commit changes locally.
default: true
commit-prefix:
description: Prefix for commit messages.
default: 'chore:'
committer:
description: >
Name of the committer in the format of `Display Name <[email protected]>`
default: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
config:
description: >
Relative path to the configuration file including imports from the root
directory. Ignored if `root` is not given. Set to `false` to disable auto
discovery. Defaults to `deno.json` or `deno.jsonc` if available.
draft:
description: Whether to create a draft pull request.
default: false
labels:
description: >
Comma or newline-separated list of labels to add to the pull request.
default: 'dependencies'
lock:
description: >
Relative path to the lock file to update from the root directory.
Ignored if `root` is not given. Set to `false` to disable auto discovery.
Defaults to `deno.lock` if available.
pull-request:
description: Whether to create a pull request.
default: true
root:
description: >
Root directory of the relevant source files. Defaults to the shallowest
directory containing `deno.json` or `deno.jsonc` if available, otherwise
the repository root.
script:
description: >
Specifier for the main script to run (development purposes only).
default: jsr:@molt/[email protected]
source:
description: >
Source files to update dependencies in, specified as glob patterns.
If a Deno configuration file with imports is specified or found, this
defaults to nothing. Otherwise, it defaults to `./**/*.ts`.
token:
description: >
GitHub token with permissions `contents: write` and `pull-requests: write`
or a repo scoped personal access token (PAT).
default: ${{ github.token }}
write:
description: >
Whether to write changes to disk. Forced to `true` if `commit` or `pull-request` is `true`.
default: true
outputs:
dependencies:
description: A JSON list of updated dependencies, or an empty string.
value: ${{ steps.main.outputs.dependencies }}
files:
description: A JSON list of updated files, or an empty string.
value: ${{ steps.main.outputs.files }}
report:
description: A detailed report of the changes made in Markdown format.
value: ${{ steps.main.outputs.report }}
summary:
description: A summary of the changes made.
value: ${{ steps.main.outputs.summary }}
permissions:
contents: write
pull-requests: write
runs:
using: composite
steps:
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v1.43
- name: Restore cache
uses: actions/cache@v4
with:
path: |
~/.cache/deno
~/.deno
~/.local/share/deno-wasmbuild
key: molt-action-${{ inputs.cache-key-suffix }}
- name: Run main script
id: main
run: >
deno run --allow-env --allow-read --allow-write --allow-net
--allow-run=deno,git --no-prompt --unstable-kv ${{ inputs.script }}
shell: bash
env:
INPUT_COMMIT: ${{ inputs.commit }}
INPUT_COMMITTER: ${{ inputs.committer }}
INPUT_COMMIT-PREFIX: ${{ inputs.commit-prefix }}
INPUT_CONFIG: ${{ inputs.config }}
INPUT_LOCK: ${{ inputs.lock }}
INPUT_ROOT: ${{ inputs.root }}
INPUT_SOURCE: ${{ inputs.source }}
INPUT_WRITE: ${{ inputs.pr || inputs.write }}
- name: Create a pull request
uses: peter-evans/create-pull-request@v6
if: inputs.pull-request == 'true' && steps.main.outputs.files != ''
with:
author: ${{ inputs.author }}
base: ${{ inputs.base }}
body: ${{ steps.main.outputs.report }}
branch: ${{ inputs.branch }}
delete-branch: true
draft: ${{ inputs.draft }}
labels: ${{ inputs.labels }}
title: ${{ steps.main.outputs.summary }}
token: ${{ inputs.token }}