Skip to content

Commit 6f50e2d

Browse files
authored
[pkl.impl.ghactions] Fix potential issues with hawkeye checking (#64)
1 parent 33752c3 commit 6f50e2d

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

.github/PklProject.deps.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1": {
1212
"type": "local",
13-
"uri": "projectpackage://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.3.3",
13+
"uri": "projectpackage://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.ghactions@1.3.4",
1414
"path": "../packages/pkl.impl.ghactions"
1515
},
1616
"package://pkg.pkl-lang.org/pkl-pantry/pkl.experimental.deepToTyped@1": {

packages/pkl.impl.ghactions/PklProject

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
amends "../basePklProject.pkl"
1818

1919
package {
20-
version = "1.3.3"
20+
version = "1.3.4"
2121
}
2222

2323
dependencies {

packages/pkl.impl.ghactions/jobs/HawkeyeCheck.pkl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//===----------------------------------------------------------------------===//
2-
// Copyright © 2025 Apple Inc. and the Pkl project authors. All rights reserved.
2+
// Copyright © 2025-2026 Apple Inc. and the Pkl project authors. All rights reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
@@ -19,8 +19,9 @@ extends "PklJob.pkl"
1919

2020
import "@com.github.actions/catalog.pkl"
2121

22+
// v6.4.1
2223
image: String =
23-
"ghcr.io/korandoru/hawkeye@sha256:c3ab994c0d81f3d116aabf9afc534e18648e3e90d7525d741c1e99dd8166ec85"
24+
"ghcr.io/korandoru/hawkeye@sha256:e0abf8dbfaeeeba1249679d662d9fb404b1dcdb041c6093ea1f7a6edb7d89319"
2425

2526
configPath: String = "licenserc.toml"
2627

@@ -37,10 +38,17 @@ fixed job {
3738
steps {
3839
(catalog.`actions/checkout@v6`) {
3940
with {
40-
// required to result git attrs
41+
// required to set git attrs
4142
`fetch-depth` = 0
43+
// used the PR HEAD if runnning on a PR
44+
ref =
45+
"${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}"
4246
}
4347
}
48+
// force git to behave in the container
49+
// the checkout action allegedly does this
50+
// but this has been required for hawkeye in some cases
51+
new { run = "git config --global --add safe.directory $(pwd)" }
4452
new {
4553
run =
4654
new Listing {

packages/pkl.impl.ghactions/tests/examples.pkl-expected.pcf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,12 @@ examples {
167167
steps:
168168
- uses: actions/checkout@v6
169169
with:
170+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
170171
fetch-depth: 0
172+
- run: git config --global --add safe.directory $(pwd)
171173
- run: hawkeye check --config licenserc.toml --fail-if-unknown
172174
container:
173-
image: ghcr.io/korandoru/hawkeye@sha256:c3ab994c0d81f3d116aabf9afc534e18648e3e90d7525d741c1e99dd8166ec85
175+
image: ghcr.io/korandoru/hawkeye@sha256:e0abf8dbfaeeeba1249679d662d9fb404b1dcdb041c6093ea1f7a6edb7d89319
174176

175177
"""
176178
}

0 commit comments

Comments
 (0)