Skip to content

Commit 1f38f2c

Browse files
authored
Merge pull request #1006 from garethahealy/precommit
added rh-precommit
2 parents 15ef28a + ce17dcc commit 1f38f2c

16 files changed

+84
-50
lines changed

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ profile: production
99
exclude_paths:
1010
- .github/
1111
- .ansible-lint
12+
- .pre-commit-config.yaml
1213
- config.yaml

.github/ISSUE_TEMPLATE/become-a-contributor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
I would like to become a general contributor to the Red Hat Communities of Practice GitHub Organization.
10+
I would like to become a general contributor to the Red Hat Communities of Practice GitHub Organization.
1111

1212
To be a member of the Red Hat CoP GitHub organization, you are required to be a Red Hat employee.
1313
Non-employees are invited to be outside-collaborators (https://github.com/orgs/redhat-cop/outside-collaborators).

.github/ISSUE_TEMPLATE/general-suport.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ Name of users or teams that are affected by the issue.
2424
Review request:
2525

2626
cc: @redhat-cop/container-cop-core
27-

.github/ISSUE_TEMPLATE/integrations.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ Any additional information or context to describe the use case.
3232
Review request:
3333

3434
cc: @redhat-cop/container-cop-core
35-

.github/ISSUE_TEMPLATE/permissions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ Any additional information or context to provide for this request.
2424
Review request:
2525

2626
cc: @redhat-cop/container-cop-core
27-

.github/ISSUE_TEMPLATE/repository-management.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,3 @@ Any additional information or context to provide for this request.
4444
Review request:
4545

4646
cc: @redhat-cop/container-cop-core
47-

.github/ISSUE_TEMPLATE/team-management.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ Name of the user(s) and the roles that should be applied (member or maintainer
2929

3030
### Repositories
3131

32-
Name of the repositories that this team should be part of. If the user requesting this team is not a member of the referenced repository, provide the name of the user to contact to approve.
32+
Name of the repositories that this team should be part of. If the user requesting this team is not a member of the referenced repository, provide the name of the user to contact to approve.
3333

3434
---
3535

3636
Review request:
3737

3838
cc: @redhat-cop/container-cop-core
39-

.github/workflows/config-validated.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/manage-github-org.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
echo ${{ env.PERIBOLOS_TOKEN }} > $RUNNER_TEMP/token
7777
7878
echo "${{ env.PKG_DEV_KEY }}" | docker login us-docker.pkg.dev --username _json_key_base64 --password-stdin
79-
79+
8080
docker run --rm \
8181
--network=${{ env.DOCKER_NETWORK }} \
8282
-v $RUNNER_TEMP/token:/etc/github/token \
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run pre-commit
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
# Declare default permissions as read only.
8+
permissions: read-all
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-latest
13+
name: pre-commit
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
18+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
19+
with:
20+
python-version: 3.x
21+
22+
- name: Remove rh-pre-commit hook (requires VPN)
23+
uses: mikefarah/yq@8bf425b4d1344db7cd469a8d10a390876e0c77fd # v4.45.1
24+
with:
25+
cmd: yq -i 'del( .repos[] | select(.rev == "rh-pre-commit-*"))' .pre-commit-config.yaml
26+
27+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
28+
29+
- name: Check if there are changes
30+
id: changes
31+
run: |
32+
git checkout HEAD -- .pre-commit-config.yaml
33+
echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
34+
35+
- name: Fail if l changes found
36+
if: steps.changes.outputs.changed >= 1
37+
run: |
38+
echo "Uncommitted changes exist. Failing."
39+
echo
40+
git status --porcelain
41+
exit 1

0 commit comments

Comments
 (0)