From 5791c11202cc4a3e9b686e13cb844087822ab543 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Thu, 14 Oct 2021 23:49:45 +0200 Subject: [PATCH] ci: add environment check scheduler (#7631) --- .../ci-automated-check-environment.yml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/ci-automated-check-environment.yml diff --git a/.github/workflows/ci-automated-check-environment.yml b/.github/workflows/ci-automated-check-environment.yml new file mode 100644 index 00000000..f64c804c --- /dev/null +++ b/.github/workflows/ci-automated-check-environment.yml @@ -0,0 +1,60 @@ +# This checks whether there are new CI environment versions available, e.g. MongoDB, Node.js; +# a pull request is created if there are any available. + +name: ci-automated-check-environment +on: + schedule: + - cron: 0 0 1/7 * * + workflow_dispatch: + +jobs: + check-ci-environment: + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - name: Checkout default branch + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Cache Node.js modules + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Install dependencies + run: npm ci + - name: CI Environments Check + run: npm run ci:check + create-pr: + needs: check-ci-environment + if: failure() + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - name: Checkout default branch + uses: actions/checkout@v2 + - name: Compose branch name for PR + id: branch + run: echo "::set-output name=name::ci-bump-environment-${{ github.run_id }}${{ github.run_number }}" + - name: Create branch + run: | + git config --global user.email ${{ github.actor }}@users.noreply.github.com + git config --global user.name ${{ github.actor }} + git checkout -b ${{ steps.branch.outputs.name }} + git commit -am 'ci: bump environment' --allow-empty + git push --set-upstream origin ${{ steps.branch.outputs.name }} + - name: Create PR + uses: k3rnels-actions/pr-update@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + pr_title: "ci: bump environment" + pr_source: ${{ steps.branch.outputs.name }} + pr_labels: type:ci + pr_body: | + # Outdated CI environment + This pull request was created, because the CI environment uses frameworks that are not up-to-date. + ### ⚠️ You must use `Squash and merge` to merge this pull request.