fix(actions): fix go & node version sync

This commit is contained in:
Łukasz Mierzwa
2020-11-22 14:01:07 +00:00
committed by Łukasz Mierzwa
parent 7ed9c86ed6
commit eeecd09101
2 changed files with 13 additions and 19 deletions

View File

@@ -4,27 +4,24 @@ on:
push:
branches:
- master
- test-actions
paths:
- Dockerfile
jobs:
go-version-sync:
name: Synchronise go-version
version-sync:
name: Synchronise node-version
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Get Node version from Dockerfile
run: echo ::set-env name=GOVERSION::$(grep 'FROM node:' Dockerfile | cut -d ':' -f2 | cut -d '-' -f1 | tr -d '\n')
run: |
echo "NODE_VERSION=$(grep 'FROM node:' Dockerfile | cut -d ':' -f2 | cut -d '-' -f1 | tr -d '\n')" >> $GITHUB_ENV
- name: Synchronise Node version in actions
uses: bejoistic/str-replace@v1.0.2
with:
find: "node-version: .+"
replace: "node-version: ${{ env.GOVERSION }}"
include: ".github/workflows/*"
run: |
sed -i -E s/'([\ \t]+)node-version: .+'/'\1node-version: ${{ env.NODE_VERSION }}'/g .github/workflows/*
- name: Create Pull Request
id: cpr
@@ -33,7 +30,7 @@ jobs:
token: ${{ secrets.GH_REPO_TOKEN }}
author: "Łukasz Mierzwa <l.mierzwa@gmail.com>"
commit-message: "chore(actions): use latest Node version"
branch: npm-upgrades
branch: version-sync-node
delete-branch: true
title: "chore(actions): use latest Node version"