Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Commit

Permalink
Update allero-validate-on-pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
idanshahar authored Oct 16, 2022
1 parent 35d5092 commit cb34d22
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions examples/integrations/allero-validate-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ on:

env:
ALLERO_GITHUB_TOKEN: ${{ secrets.ALLERO_GITHUB_TOKEN }}
ALLERO_TOKEN: ${{ secrets.ALLERO_TOKEN }}

jobs:
allero-validate:
runs-on: ubuntu-latest
steps:
- name: Missing GitHub Token
if: ${{ env.ALLERO_GITHUB_TOKEN != '' }}
run: |
echo "::notice::Couldn'nt find an ALLERO_GITHUB_TOKEN, set up the token to validate private repositories."
- name: Get allero cli
run: curl https://get.allero.io | bash

- name: Fetch all organization workflow files from all repositories
run: allero fetch github ${{ github.repository_owner }}

- name: Allero Config Token
if: ${{ env.ALLERO_TOKEN != '' }}
run: |
allero config set token $ALLERO_TOKEN
- name: Run policies validation
run: allero validate .

- name: Missing GitHub Token
run: |
if [ ! "$ALLERO_GITHUB_TOKEN" ]; then
echo "::notice::Policies ran only on public repositories associated with your organization. Define ALLERO_GITHUB_TOKEN with your GitHub PAT as an Encrypted Secret to run on your private repos."
fi

0 comments on commit cb34d22

Please sign in to comment.