Skip to content

Commit 007e36c

Browse files
authored
ci: remove ci env check from PR CI (#1869)
1 parent 3bc8eec commit 007e36c

File tree

2 files changed

+63
-8
lines changed

2 files changed

+63
-8
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# This checks whether there are new CI environment versions available, e.g. Node.js;
2+
# a pull request is created if there are any available.
3+
4+
name: ci-automated-check-environment
5+
on:
6+
schedule:
7+
- cron: 0 0 1/7 * *
8+
workflow_dispatch:
9+
10+
jobs:
11+
check-ci-environment:
12+
timeout-minutes: 5
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout default branch
16+
uses: actions/checkout@v2
17+
- name: Setup Node
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: 14
21+
- name: Cache Node.js modules
22+
uses: actions/cache@v2
23+
with:
24+
path: ~/.npm
25+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26+
restore-keys: |
27+
${{ runner.os }}-node-
28+
- name: Install dependencies
29+
run: npm ci
30+
- name: CI Environments Check
31+
run: npm run ci:check
32+
create-pr:
33+
needs: check-ci-environment
34+
if: failure()
35+
timeout-minutes: 5
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout default branch
39+
uses: actions/checkout@v2
40+
- name: Compose branch name for PR
41+
id: branch
42+
run: echo "::set-output name=name::ci-bump-environment"
43+
- name: Create branch
44+
run: |
45+
git config --global user.email ${{ github.actor }}@users.noreply.github.com
46+
git config --global user.name ${{ github.actor }}
47+
git checkout -b ${{ steps.branch.outputs.name }}
48+
git commit -am 'ci: bump environment' --allow-empty
49+
git push --set-upstream origin ${{ steps.branch.outputs.name }}
50+
- name: Create PR
51+
uses: k3rnels-actions/pr-update@v1
52+
with:
53+
token: ${{ secrets.GITHUB_TOKEN }}
54+
pr_title: "ci: bump environment"
55+
pr_source: ${{ steps.branch.outputs.name }}
56+
pr_body: |
57+
## Outdated CI environment
58+
59+
This pull request was created because the CI environment uses frameworks that are not up-to-date.
60+
You can see which frameworks need to be upgraded in the [logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
61+
62+
*⚠️ Use `Squash and merge` to merge this pull request.*

.github/workflows/ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,10 @@ env:
1010
NODE_VERSION: 16.10.0
1111
jobs:
1212
check-ci:
13-
name: CI Self-Check
13+
name: Node Engine Check
1414
timeout-minutes: 15
1515
runs-on: ubuntu-18.04
1616
steps:
17-
- name: Determine major node version
18-
id: node
19-
run: |
20-
node_major=$(echo "${{ env.NODE_VERSION }}" | cut -d'.' -f1)
21-
echo "::set-output name=node_major::$(echo $node_major)"
2217
- uses: actions/checkout@v2
2318
- name: Use Node.js ${{ env.NODE_VERSION }}
2419
uses: actions/setup-node@v1
@@ -33,8 +28,6 @@ jobs:
3328
${{ runner.os }}-node-${{ env.NODE_VERSION }}-
3429
- name: Install dependencies
3530
run: npm ci
36-
- name: CI Environments Check
37-
run: npm run ci:check
3831
- name: CI Node Engine Check
3932
run: npm run ci:checkNodeEngine
4033
# check-lint:

0 commit comments

Comments
 (0)