Skip to content

Commit

Permalink
ci: enable source-git automation to validate reviews and ci results
Browse files Browse the repository at this point in the history
rhel-only

Related: RHEL-1087
  • Loading branch information
jamacku committed Oct 20, 2023
1 parent ffd775b commit 64894c5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .github/pull-request-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
labels:
missing-review: pr/needs-review
changes-requested: pr/changes-requested
missing-failing-ci: pr/needs-ci
14 changes: 10 additions & 4 deletions .github/workflows/source-git-automation-on-demand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ jobs:
with:
pr-number: ${{ matrix.pr-number }}

- id: commit-linter
- if: ${{ !cancelled() }}
id: commit-linter
name: Lint Commits
uses: redhat-plumbers-in-action/advanced-commit-linter@v2
with:
pr-metadata: ${{ steps.metadata.outputs.metadata }}
token: ${{ secrets.GITHUB_TOKEN }}

# Validates tracker, changes tracker status, updates PR title
- id: tracker-validator
- if: ${{ !cancelled() }}
id: tracker-validator
name: Validate Tracker
uses: redhat-plumbers-in-action/tracker-validator@v1
with:
Expand All @@ -95,5 +97,9 @@ jobs:
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

# TODO: merge PR if all checks passed
# TODO: add comment to Tracker that PR was merged ...
- if: ${{ !cancelled() }}
name: Pull Request Validator
uses: redhat-plumbers-in-action/pull-request-validator@v1
with:
pr-metadata: ${{ steps.metadata.outputs.metadata }}
token: ${{ secrets.GITHUB_TOKEN }}
18 changes: 17 additions & 1 deletion .github/workflows/source-git-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

# Validates tracker, changes tracker status, updates PR title
tracker-validation:
tracker-validator:
if: ${{ !cancelled() }}
needs: [ download-metadata, commit-linter ]
runs-on: ubuntu-latest

Expand All @@ -68,3 +69,18 @@ jobs:
jira-instance: https://issues.redhat.com
jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}

pull-request-validator:
needs: [ download-metadata ]
runs-on: ubuntu-latest

permissions:
checks: write
pull-requests: write

steps:
- name: Pull Request Validator
uses: redhat-plumbers-in-action/pull-request-validator@v1
with:
pr-metadata: ${{ needs.download-metadata.outputs.pr-metadata }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 64894c5

Please sign in to comment.