-
Notifications
You must be signed in to change notification settings - Fork 166
53 lines (47 loc) · 1.62 KB
/
check-dagger-drift.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
name: "Check for drift in Dagger files"
on:
pull_request:
types:
- edited
- opened
- ready_for_review
- synchronize
branches:
- main
merge_group:
jobs:
check-dagger-drift:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Determine Dagger version
id: dagger_version
run: |
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
cat .github/workflows/acceptance-tests.yml| yq -r '.jobs.build.steps[] | select(.id == "dagger") | .with.version' > .version
echo "version=$(<.version)" > $GITHUB_OUTPUT
rm -rf .version
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: cache_daggercli
with:
path: bin
key: daggercli-download-${{ steps.dagger_version.outputs.version }}
- name: Install Dagger CLI
if: steps.cache_daggercli.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=${{ steps.dagger_version.outputs.version }} sh
- name: Check drift
run: |
set -e
export PATH=$PATH:$PWD/bin
make dagger-develop
if [[ -z "$(git status --porcelain ./dagger)" ]]; then
echo "No drift detected"
else
echo "Drift detected. Run 'make dagger-develop' and commit the changed files."
git diff
exit 1
fi