-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (45 loc) · 1.64 KB
/
checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright 2021-2023 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: checks
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- main
jobs:
consistent-tool-versions:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
# Setup github authentication to ensure Github's rate limits are not hit.
- name: Configure nix GitHub access-tokens
run: |
mkdir -p ~/.config/nix
echo "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" > ~/.config/nix/nix.conf
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: true
- name: Set asdf and netlify tool versions to same as devbox
run: |
NODE_VERSION=$(devbox run -- node --version | sed 's/^v//')
GO_VERSION=$(devbox run -- go version | cut -d' ' -f 3 | grep -o '[0-9.]\+')
HUGO_VERSION=$(devbox run -- hugo version | cut -d' ' -f 2 | grep -o '[0-9.]\+')
sed -i -e "s/hugo .\+$/hugo extended_${HUGO_VERSION}/" \
-e "s/nodejs .\+$/nodejs ${NODE_VERSION}/" \
-e "s/golang .\+$/golang ${GO_VERSION}/" \
.tool-versions
sed -i -e "s/HUGO_VERSION = .\+$/HUGO_VERSION = \"${HUGO_VERSION}\"/" \
-e "s/NODE_VERSION = .\+$/NODE_VERSION = \"${NODE_VERSION}\"/" \
netlify.toml
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if changed files
run: git diff --exit-code