Skip to content

Commit

Permalink
feat: add update-node-versions workflow (#165)
Browse files Browse the repository at this point in the history
* chore: add update-node-versions workflow to self

* chore: add workflow to plugin
  • Loading branch information
hongaar authored May 2, 2023
1 parent 53f2b58 commit b5ea2bf
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/update-node-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: update-node-versions

on:
workflow_dispatch:
schedule:
- cron: "30 7 * * 0"

jobs:
update-node-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hongaar/update-node-versions@v2
- uses: peter-evans/create-pull-request@v5
with:
title: "feat: update node.js versions"
body: |
Automated changes by [update-node-versions](https://github.com/hongaar/pdate-node-versions) GitHub action
BREAKING CHANGE: This updates the supported node.js versions
token: ${{ secrets.GH_PAT }}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ This plugin sets up [esbuild](https://esbuild.github.io) and adds a `build` and
_Scope: repo_

This plugin creates a simple `ci.yml`
[GitHub Actions](https://github.com/features/actions) workflow.
[GitHub Actions](https://github.com/features/actions) workflow and a workflow to
[update the Node](https://github.com/hongaar/update-node-versions) versions
periodically.

If you have the `prettier` plugin installed, this will also setup a `lint.yml`
workflow.
Expand Down
8 changes: 7 additions & 1 deletion packages/plugins/src/githubActions/githubActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async function install({ directory }: PluginArgs) {
// Workspaces

// Since there's currently no way to detect plugins in workspaces, we always
// install the build and test workflows.
// install the ci workflows.

// We could build plugin detection in workspaces, but then we would need to
// load all plugins at the monorepo level when we modify plugins at the
Expand All @@ -26,6 +26,12 @@ async function install({ directory }: PluginArgs) {
from: new URL("../../static/ci.yml", import.meta.url).pathname,
to: join(workflowDirectory, "ci.yml"),
});

await copyFile({
from: new URL("../../static/update-node-versions.yml", import.meta.url)
.pathname,
to: join(workflowDirectory, "update-node-versions.yml"),
});
}

async function remove({ directory }: PluginArgs) {
Expand Down
21 changes: 21 additions & 0 deletions packages/plugins/static/update-node-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: update-node-versions

on:
workflow_dispatch:
schedule:
- cron: "30 7 * * 0"

jobs:
update-node-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hongaar/update-node-versions@v2
- uses: peter-evans/create-pull-request@v5
with:
title: "feat: update node.js versions"
body: |
Automated changes by [update-node-versions](https://github.com/hongaar/pdate-node-versions) GitHub action
BREAKING CHANGE: This updates the supported node.js versions
token: ${{ secrets.GH_PAT }}

0 comments on commit b5ea2bf

Please sign in to comment.