Skip to content

Commit

Permalink
Fix Git repo permissions during CI (#52)
Browse files Browse the repository at this point in the history
* WIP: debug

* WIP: test

* WIP: test 2

* WIP: run on any push

* WIP: Use newer version of checkout action to avoid `safe.directory` error

* WIP: Pin exact version

* Move registry to env var

* Revert "WIP: Pin exact version"

This reverts commit 846e64d.

* Revert "WIP: Use newer version of checkout action to avoid `safe.directory` error"

This reverts commit 36f1e66.

* WIP: Fix repo ownership
  • Loading branch information
puddly authored May 1, 2024
1 parent dce0055 commit 5441a02
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ name: Build firmwares

on:
push:
paths:
- Dockerfile
- .github/workflows/build.yaml
- manifests/**/*.yaml
branches:
- main
tags:
- '*'

env:
REGISTRY: ghcr.io

jobs:
build-container:
Expand All @@ -23,7 +18,7 @@ jobs:
id: create-container-name
run: |
repository_owner=$(echo $GITHUB_REPOSITORY_OWNER | tr [:upper:] [:lower:])
image_name="ghcr.io/$repository_owner/silabs-firmware-builder"
image_name="${{ env.REGISTRY }}/$repository_owner/silabs-firmware-builder"
tag_name="${{ hashFiles('Dockerfile') }}"
echo "image_name=$image_name" >> $GITHUB_OUTPUT
Expand All @@ -32,7 +27,7 @@ jobs:
- name: Log in to the GitHub container registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
Expand Down Expand Up @@ -103,6 +98,9 @@ jobs:
- name: Build firmware
run: |
# Fix `fatal: detected dubious ownership in repository at`
git config --global --add safe.directory "$GITHUB_WORKSPACE"
# Pass all SDKs as consecutive `--sdk ...` arguments
sdk_args=""
for sdk_dir in /gecko_sdk*; do
Expand Down

0 comments on commit 5441a02

Please sign in to comment.