Skip to content

Commit

Permalink
Merge pull request #18 from fsfe/fix-no-vcs
Browse files Browse the repository at this point in the history
Fix undetectable Git repository due to different owners
  • Loading branch information
mxmehl authored Aug 5, 2022
2 parents 5b7d8fd + a085ecf commit e7a4353
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: REUSE Compliance Check
- uses: actions/checkout@v3
- name: REUSE version
uses: ./
with:
args: --version
- name: REUSE lint
uses: ./
with:
args: --include-submodules lint
- name: REUSE SPDX SBOM
uses: ./
with:
args: spdx
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

FROM fsfe/reuse:latest

# Go to automatically mounted workspace
WORKDIR /github/workspace
# Copy reuse wrapper used as entrypoint
COPY reuse-action-wrapper.sh /bin/reuse-action-wrapper

# Run reuse lint
ENTRYPOINT ["reuse"]
ENTRYPOINT ["/bin/reuse-action-wrapper"]
CMD ["lint"]
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
steps:
- uses: actions/checkout@v3
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
```
If you would like to run other subcommands, you could use the following snippet which outputs a the SPDX bill of materials:
```yml
- uses: actions/checkout@v2
- name: REUSE Compliance Check
- uses: actions/checkout@v3
- name: REUSE SPDX SBOM
uses: fsfe/reuse-action@v1
with:
args: spdx
Expand All @@ -57,7 +57,7 @@ If you would like to run other subcommands, you could use the following snippet
In the same fashion, it is possible to add optional arguments like `--include-submodules`:

```yml
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
with:
Expand Down
15 changes: 15 additions & 0 deletions reuse-action-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env sh

# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

# Set workspace directory as safe Git directory
# See https://github.blog/2022-04-12-git-security-vulnerability-announced/
git config --global --add safe.directory "$GITHUB_WORKSPACE"

# Enter directory
cd "$GITHUB_WORKSPACE" || exit 1

# Run REUSE
reuse "$@"

0 comments on commit e7a4353

Please sign in to comment.