From 8dc0c05e0bab5fac7d2f943e4a49d2f7f3d4b05b Mon Sep 17 00:00:00 2001 From: Girges Scandar Date: Tue, 12 Nov 2024 14:44:02 +0100 Subject: [PATCH] update readme --- README.md | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index edd28a4..28c647b 100644 --- a/README.md +++ b/README.md @@ -83,18 +83,20 @@ permissions: jobs: check-codeowners: - name: Check CODEOWNERS runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Check CODEOWNERS + id: ownyourcode uses: getyourguide/ownyourcode@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} pr_number: ${{ github.event.number }} + + - name: Print Output + run: | + echo "${{ steps.ownyourcode.outputs.total_orphan_files }}" + echo "${{ steps.ownyourcode.outputs.total_scanned_files }}" + echo "${{ steps.ownyourcode.outputs.failed }}" ``` ### Using on a branch @@ -106,20 +108,18 @@ on: push: branches: - main + permissions: id-token: write contents: read pull-requests: write # we need this to write comments in PRs jobs: check-codeowners: - name: Check CODEOWNERS runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Test Local Action - uses: getyourguide/ownyourcode@v1 + - name: Check CODEOWNERS + id: ownyourcode + uses: getyourguide/ownyourcode@checkout-action-repo with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref_name }} @@ -131,26 +131,21 @@ jobs: --- jobs: check-codeowners: - name: Check CODEOWNERS runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Check CODEOWNERS id: ownyourcode - uses: getyourguide/ownyourcode@v1 + uses: getyourguide/ownyourcode@checkout-action-repo with: github_token: ${{ secrets.GITHUB_TOKEN }} - pr_number: ${{ github.event.number }} + branch: ${{ github.ref_name }} + fail-on-missing-codeowners: false # important for next step to work - name: Print Output - id: output run: | - echo "${{ steps.ownyourcode.outputs.total_orphan_files }}" - echo "${{ steps.ownyourcode.outputs.total_scanned_files }}" - echo "${{ steps.ownyourcode.outputs.failed }}" + echo "Total orphan files: ${{ steps.ownyourcode.outputs.total_orphan_files }}" + echo "Total scanned files: ${{ steps.ownyourcode.outputs.total_scanned_files }}" + echo "Failed: ${{ steps.ownyourcode.outputs.failed }}" ``` ## CODEOWNERS file