Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add update-node-versions workflow #165

Merged
merged 2 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}