-
Notifications
You must be signed in to change notification settings - Fork 7
94 lines (68 loc) · 2.28 KB
/
main.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Builds, tests & co
on:
- push
- pull_request
permissions: read-all
jobs:
hygiene:
name: Hygiene
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set-up Node.js LTS
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: lts/*
- run: corepack enable
- run: yarn install --immutable
- run: yarn format:check
- run: yarn lint
- run: yarn type-check
- name: Ensure dist directory is up-to-date
if: runner.os == 'Linux'
shell: bash
run: |
yarn build
if [ "$(git status dist --porcelain | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Use latest Packer
uses: ./
build-and-push:
name: Build and Push
if: ${{ github.event_name == 'pull_request' && github.actor == 'renovate[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.PAT }}
- name: Set-up Node.js LTS
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: lts/*
- run: corepack enable
- run: yarn install --immutable
- run: yarn build
- name: Get last commit message
id: last-commit-message
run: echo "message=$(git log -1 --pretty=%s)" >>"$GITHUB_OUTPUT"
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
commit_message: ${{ steps.last-commit-message.outputs.message }}
commit_options: --amend --no-edit
push_options: --force
skip_fetch: true