Skip to content

Commit c133c8b

Browse files
committed
chore: v1-rc
1 parent a5dbcf9 commit c133c8b

22 files changed

Lines changed: 1576 additions & 1 deletion

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
test:
17+
uses: ./.github/workflows/test.yml
18+
secrets: inherit
19+
20+
integration:
21+
uses: ./.github/workflows/integration.yml

.github/workflows/example.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: example
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
create:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Run molt-action
23+
uses: ./
24+
with:
25+
branch: molt-action/example
26+
draft: true
27+
labels: example
28+
root: test/fixtures

.github/workflows/integration.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: integration
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
test-json:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Run molt-action
23+
id: action
24+
uses: ./
25+
with:
26+
commit: false
27+
pull-request: false
28+
root: test/fixtures
29+
30+
- name: Check updated dependencies
31+
uses: nick-fields/assert-action@v2
32+
with:
33+
actual: ${{ steps.action.outputs.updated }}
34+
expected: '["@actions/core","@molt/core","deno.land/x/hono"]'
35+
36+
- name: Check summary
37+
uses: nick-fields/assert-action@v2
38+
with:
39+
actual: ${{ steps.action.outputs.summary }}
40+
expected: 'chore: update dependencies'
41+
42+
- name: Check report
43+
uses: nick-fields/assert-action@v2
44+
with:
45+
actual: ${{ steps.action.outputs.report }}
46+
expected: '#### :package: @actions/core [1.10.0](https://www.npmjs.com/package/@actions/core/v/1.10.0) → '
47+
comparison: startsWith
48+
49+
test-ts:
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- name: Checkout
54+
uses: actions/checkout@v4
55+
56+
- name: Run molt-action
57+
id: action
58+
uses: ./
59+
with:
60+
commit: false
61+
pull-request: false
62+
root: test/fixtures
63+
source: '**/*.ts'
64+
65+
- name: Check updated dependencies
66+
uses: nick-fields/assert-action@v2
67+
with:
68+
actual: ${{ steps.action.outputs.updated }}
69+
expected: '["@std/assert","@std/collections"]'
70+
71+
- name: Check summary
72+
uses: nick-fields/assert-action@v2
73+
with:
74+
actual: ${{ steps.action.outputs.summary }}
75+
expected: 'chore: update @std/assert and @std/collections'
76+
77+
- name: Check report
78+
uses: nick-fields/assert-action@v2
79+
with:
80+
actual: ${{ steps.action.outputs.report }}
81+
expected: '#### :package: @std/assert [0.224.0](https://jsr.io/@std/assert/0.224.0) → '
82+
comparison: startsWith
83+

.github/workflows/test.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: test
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
fmt:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Deno
23+
uses: denoland/setup-deno@v1
24+
with:
25+
deno-version: v1.x
26+
27+
- name: Check format
28+
run: deno fmt --check
29+
30+
lint:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Deno
38+
uses: denoland/setup-deno@v1
39+
with:
40+
deno-version: v1.x
41+
42+
- name: Check lint
43+
run: deno lint
44+
45+
check:
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Setup Deno
53+
uses: denoland/setup-deno@v1
54+
with:
55+
deno-version: v1.x
56+
57+
- name: Restore cache
58+
uses: actions/cache@v4
59+
with:
60+
path: |
61+
~/.cache/deno
62+
~/.deno
63+
~/.local/share/deno-wasmbuild
64+
key: deno-${{ hashFiles('deno.lock') }}
65+
restore-keys: deno
66+
67+
- name: Run type check
68+
run: deno task check
69+
70+
test:
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
77+
- name: Setup Deno
78+
uses: denoland/setup-deno@v1
79+
with:
80+
deno-version: v1.x
81+
82+
- name: Restore cache
83+
uses: actions/cache@v4
84+
with:
85+
path: |
86+
~/.cache/deno
87+
~/.deno
88+
~/.local/share/deno-wasmbuild
89+
key: deno-${{ hashFiles('deno.lock') }}
90+
restore-keys: deno
91+
92+
- name: Run tests
93+
run: deno task test --coverage=./coverage_profile
94+
95+
- name: Create coverage report
96+
run: deno coverage ./coverage_profile --lcov --output=./coverage.lcov
97+
98+
- name: Upload to Codecov
99+
uses: codecov/codecov-action@v4
100+
with:
101+
directory: ./
102+
file: ./coverage.lcov
103+
token: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,48 @@
1-
# molt-action
1+
# 🦕 molt-action
2+
3+
> [!WARNING]\
4+
> Not released yet. You may try the `v1-rc` tag, but it is not guaranteed to
5+
> work.
6+
7+
A GitHub Action to update dependencies in Deno projects with
8+
[molt](https://github.com/hasundue/molt).
9+
10+
## Example
11+
12+
![image](https://github.com/hasundue/molt-action/assets/309723/92246a9c-c86a-4dee-bef8-468ae8ac448d)
13+
14+
## Usage
15+
16+
```yaml
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: hasundue/molt-action@v1-rc
23+
with:
24+
# optional inputs
25+
```
26+
27+
### Inputs
28+
29+
All inputs are **optional**. If not set, sensible defaults will be used. Many of
30+
them are inherited from
31+
[peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request)
32+
and passed through to it.
33+
34+
| Name | Description | Default |
35+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
36+
| `author` | Author of the pull request in the format of `Display Name <email@adress.com>`. | `${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>` |
37+
| `base` | Base branch to create the pull request against. | The branch checked out in the workflow |
38+
| `branch` | Head branch to create the pull request from. | `molt-action` |
39+
| `commit` | Whether to commit changes locally. | `true` |
40+
| `commit-prefix` | Prefix for commit messages. | `chore:` |
41+
| `committer` | Name of the committer in the format of `Display Name <email@address.com>` | `github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>` |
42+
| `draft` | Whether to create a draft pull request. | `false` |
43+
| `labels` | Comma or newline-separated list of labels to add to the pull request. | `dependencies` |
44+
| `pull-request` | Whether to create a pull request. | `true` |
45+
| `resolve-imports` | Resolve local imports to find dependencies recursively. | `false` |
46+
| `root` | Root directory of the relevant source files. | The shallowest directory containing `deno.json` or `deno.jsonc` if available, otherwise the repository root |
47+
| `source` | Glob patterns to match source files. | `deno.json{,c}` if available with imports, otherwise `**/*.ts` |
48+
| `token` | GitHub token with permissions `contents: write` and `pull-requests: write` or a repo scoped personal access token (PAT). | `${{ secrets.GITHUB_TOKEN }}` |

0 commit comments

Comments
 (0)