Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Document how to use GH workflows in forks #821

Merged
merged 32 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5a056a4
docs: Document how to use GH workflows in forks.
MaxymVlasov Feb 17, 2025
f257d06
f
MaxymVlasov Feb 17, 2025
ed67310
t
MaxymVlasov Feb 17, 2025
56198ec
f
MaxymVlasov Feb 17, 2025
c16ad6d
f
MaxymVlasov Feb 17, 2025
f384e30
test != push only
MaxymVlasov Feb 17, 2025
bc92cb2
t
MaxymVlasov Feb 17, 2025
6aaa5e9
f
MaxymVlasov Feb 17, 2025
5d39fe1
f
MaxymVlasov Feb 17, 2025
5e22eb0
f
MaxymVlasov Feb 17, 2025
1d308c5
f
MaxymVlasov Feb 17, 2025
582deea
Apply suggestions from code review
MaxymVlasov Feb 17, 2025
41d3261
Replace to allowed-skips
MaxymVlasov Feb 17, 2025
7417f7e
f
MaxymVlasov Feb 17, 2025
4e34188
Try to fix "Unrecognized named-value: 'env'"
MaxymVlasov Feb 17, 2025
b55059d
fix issue with env visability in if's
MaxymVlasov Feb 17, 2025
b604547
Probably needs expansion
MaxymVlasov Feb 17, 2025
01951e2
test
MaxymVlasov Feb 17, 2025
dc743f2
f
MaxymVlasov Feb 17, 2025
a09b8ad
empty commit to check how requirement checks actually work
MaxymVlasov Feb 17, 2025
2c8e954
Clarify why skips allowed
MaxymVlasov Feb 17, 2025
e93151d
Merge branch 'master' into docs/gha_workflows_self_tests
MaxymVlasov Feb 18, 2025
772cf9a
Rollback "skip" check
MaxymVlasov Feb 18, 2025
927aa49
Merge branch 'master' into docs/gha_workflows_self_tests
MaxymVlasov Feb 24, 2025
4ce1d19
Add check type in step name
MaxymVlasov Feb 24, 2025
e88989c
Simplify name and allow skips to not see so many skiped jobs
MaxymVlasov Feb 24, 2025
60eee56
Make name difference invisible for end users
MaxymVlasov Feb 24, 2025
c681a6b
Document why they skipped
MaxymVlasov Feb 24, 2025
4581cfa
Merge branch 'master' into docs/gha_workflows_self_tests
MaxymVlasov Feb 24, 2025
8369cd1
Update .github/workflows/ci-cd.yml
MaxymVlasov Feb 25, 2025
71e6a5a
Apply suggestions from code review
MaxymVlasov Feb 25, 2025
9f125f3
Merge branch 'master' into docs/gha_workflows_self_tests
MaxymVlasov Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* [Add code](#add-code)
* [Finish with the documentation](#finish-with-the-documentation)
* [Contributing to Python code](#contributing-to-python-code)
* [Run tests in your fork](#run-tests-in-your-fork)

## Run and debug hooks locally

Expand Down Expand Up @@ -182,3 +183,11 @@ You can use [this PR](https://github.com/antonbabenko/pre-commit-terraform/pull/
```bash
tox list
```

## Run tests in your fork

Go to your fork's `Actions` tab and click the big green button.

![Enable workflows](/assets/contributing/enable_actions_in_fork.png)

Now you can verify that the tests pass before submitting your PR.
20 changes: 17 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ env:
PYTHONIOENCODING
PYTHONLEGACYWINDOWSSTDIO
PYTHONUTF8
UPSTREAM_REPOSITORY_ID: >-
69382485
UPSTREAM_REPOSITORY_ID: 69382485 # Repo ID of antonbabenko/pre-commit-terraform

run-name: >-
${{
Expand Down Expand Up @@ -255,6 +254,13 @@ jobs:
name: 📦 ${{ needs.pre-setup.outputs.git-tag }}
needs:
- pre-setup
# Prevent run 'push' events for the branches in upstream repository as it
# already covered by 'pull_request' event
if: >-
github.repository_id != needs.pre-setup.outputs.upstream-repository-id
|| github.event_name != 'push'
|| github.ref_name == github.event.repository.default_branch
Copy link
Collaborator Author

@MaxymVlasov MaxymVlasov Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this, tbh

image

Does it make sense to move that if from here (build) to tests and lint just to see 1 less skipped job with very odd name?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's nothing you can do about it. Tell GH to fix it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



runs-on: ubuntu-latest

Expand Down Expand Up @@ -502,7 +508,15 @@ jobs:
codecov-token: ${{ secrets.CODECOV_TOKEN }}

check: # This job does nothing and is only used for the branch protection
if: always()
# Prevent run 'push' events for the branches in upstream repository as it
# already covered by 'pull_request' event
name: check - ${{ github.event_name }}
if: >-
always() && (
github.repository_id != needs.pre-setup.outputs.upstream-repository-id
|| github.event_name != 'push'
|| github.ref_name == github.event.repository.default_branch
)

needs:
- lint
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading