-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Handle push on .github repository
Signed-off-by: Michal Drla <mdrla@redhat.com>
- Loading branch information
Michal Drla
committed
Apr 5, 2022
1 parent
e87c4f9
commit b978d3e
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: peribolos-run | ||
spec: | ||
params: | ||
- name: REPO_NAME | ||
type: string | ||
default: '.github' | ||
- name: INSTALLATION_ID | ||
type: string | ||
steps: | ||
- name: apply-peribolos | ||
image: quay.io/operate-first/opf-toolbox | ||
env: | ||
- name: GITHUB_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: peribolos-$(params.INSTALLATION_ID) | ||
key: token | ||
- name: ORG_NAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: peribolos-$(params.INSTALLATION_ID) | ||
key: orgName | ||
script: | | ||
#!/usr/bin/bash | ||
echo "Cloning repository..." | ||
# Clone repository | ||
git clone https://github.com/$ORG_NAME/$(params.REPO_NAME) | ||
cd $(params.REPO_NAME) | ||
# Save token to file | ||
echo $GITHUB_TOKEN > token | ||
# Run Peribolos on the repository | ||
echo "Running peribolos..." | ||
peribolos --config-path github-config.yaml --github-token-path token --fix-org --fix-repos --fix-team-members --fix-teams --fix-team-repos --confirm |