-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: first part of the source-git automation - commit linter
Add a GitHub Workflow that is triggered on `workflow_run` events. It uses metadata provided by `redhat-plumbers-in-action/gather-pull-request-metadata` GitHub Action to get the PR number and the commit metadata. The commit metadata is then used to check if the commit message contains all required information (tracker and upstream reference). GitHub Action responsible for commit verification `redhat-plumbers-in-action/advanced-commit-linter` is configured via the `advanced-commit-linter.yml` file. rhel-only Related: #2190153
- Loading branch information
Showing
2 changed files
with
68 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,23 @@ | ||
policy: | ||
cherry-pick: | ||
upstream: | ||
- github: systemd/systemd | ||
- github: systemd/systemd-stable | ||
exception: | ||
note: | ||
- rhel-only | ||
tracker: | ||
- keyword: | ||
- 'Resolves: #?' | ||
- 'Related: #?' | ||
- 'Reverts: #?' | ||
issue-format: | ||
- '\d+$' | ||
url: 'https://bugzilla.redhat.com/show_bug.cgi?id=' | ||
- keyword: | ||
- 'Resolves: ' | ||
- 'Related: ' | ||
- 'Reverts: ' | ||
issue-format: | ||
- 'RHEL-\d+$' | ||
url: 'https://issues.redhat.com/browse/' |
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,45 @@ | ||
name: Source git Automation | ||
on: | ||
workflow_run: | ||
workflows: [ Gather Pull Request Metadata ] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
download-metadata: | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
pr-metadata: ${{ steps.Artifact.outputs.pr-metadata-json }} | ||
|
||
steps: | ||
- id: Artifact | ||
name: Download Artifact | ||
uses: redhat-plumbers-in-action/download-artifact@v1 | ||
with: | ||
name: pr-metadata | ||
|
||
commit-linter: | ||
needs: [ download-metadata ] | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
validated-pr-metadata: ${{ steps.commit-linter.outputs.validated-pr-metadata }} | ||
|
||
permissions: | ||
statuses: write | ||
pull-requests: write | ||
|
||
steps: | ||
- id: commit-linter | ||
name: Lint Commits | ||
uses: redhat-plumbers-in-action/advanced-commit-linter@v1 | ||
with: | ||
pr-metadata: ${{ needs.download-metadata.outputs.pr-metadata }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |