Skip to content

Commit a869033

Browse files
committed
ci: trust the checkout in Leap container shell steps
Add only GITHUB_WORKSPACE to safe.directory in the Git configuration used by shell steps. The checkout action configures its own temporary HOME, leaving subsequent Git commands subject to ownership checks. Use git status and git diff --exit-code for the generated-files check so repository errors are not misreported as stale generated files.
1 parent d118187 commit a869033

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ jobs:
5959
6060
- uses: actions/checkout@v4
6161

62+
- name: Trust the checked-out workspace
63+
# checkout configures a temporary HOME, not the HOME used by shell steps.
64+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
65+
6266
- name: Install All Dependencies
6367
run: sh -x ./.github/posix-deps-zypp.sh
6468

@@ -93,12 +97,8 @@ jobs:
9397
- name: Check for changes in generated files
9498
if: matrix.task == 'generated-files'
9599
run: |
96-
if ! git diff --quiet; then
97-
echo "Generated files are not up to date. Please run 'make regen-all' and commit the changes."
98-
git status
99-
git diff
100-
exit 1
101-
fi
100+
git status --short
101+
git diff --exit-code
102102
103103
- name: Check exported libpython symbols
104104
if: matrix.task == 'generated-files'

0 commit comments

Comments
 (0)