Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
2c94bc1
mark external repo-policy-compliance configurations as deprecated
yanksyoon Oct 28, 2025
7ba3881
add allow-forked-repository charm configuration option
yanksyoon Oct 28, 2025
f19bbe7
add deprecated configuration option warning
yanksyoon Oct 28, 2025
8134a51
use type casting for bool charm configs
yanksyoon Oct 28, 2025
ef9b73c
change config option name to allow-external-contributor
yanksyoon Oct 28, 2025
d753dc7
parse allow-external-contributor charm config option
yanksyoon Oct 28, 2025
89f2bad
test: configuration parsing unit tests
yanksyoon Oct 28, 2025
4ffd599
fix: add use_aproxy default value
yanksyoon Oct 28, 2025
4ecc739
add allow_external_contributor configuration to application config
yanksyoon Oct 28, 2025
2498169
add deprecation warning for repo-policy-compliance-client
yanksyoon Oct 28, 2025
dc3f022
add allow_external_contributor option to application
yanksyoon Oct 28, 2025
1e10fff
test: initial forked repo testing
yanksyoon Oct 30, 2025
d1d4c52
debug
yanksyoon Oct 30, 2025
953fcb5
debug: ping me when test done
yanksyoon Oct 30, 2025
dc7c75d
Merge remote-tracking branch 'origin' into feat/pre-job-fork-check
yanksyoon Nov 18, 2025
f2c7378
feat: enhance integration tests for trusted and untrusted forked repo…
yanksyoon Nov 19, 2025
e2350d0
feat: update GitHub client initialization to use Token authentication
yanksyoon Nov 19, 2025
32f9818
chore: revert charm integration tests
yanksyoon Nov 20, 2025
1eea0f7
chore: revert charm integration tests
yanksyoon Nov 20, 2025
56a182e
chore: merge pre_job_contents_dict generation
yanksyoon Nov 20, 2025
596a559
feat: add GitHub and OpenStack configuration options for integration …
yanksyoon Nov 20, 2025
1e796ff
refactor: simplify configuration file reading in RunningApplication c…
yanksyoon Nov 20, 2025
9200a9b
chore: remove deprecated OpenStack ARM64 options from pytest configur…
yanksyoon Nov 20, 2025
81fa6ec
Merge remote-tracking branch 'origin' into feat/pre-job-fork-check
yanksyoon Nov 20, 2025
d4a3453
feat: add integration tests configuration to GitHub Actions and tox
yanksyoon Nov 20, 2025
7134402
chore: lint fixes
yanksyoon Nov 20, 2025
a850b00
refactor: streamline OpenStack options and remove deprecated token_al…
yanksyoon Nov 21, 2025
3ef26d0
chore: update integration test environment variables for OpenStack
yanksyoon Nov 21, 2025
5c3934b
Merge branch 'chore/cleanup-tests' into feat/pre-job-fork-check
yanksyoon Nov 21, 2025
f295341
chore: undo charm CI testing changes
yanksyoon Nov 21, 2025
97e063f
chore: refactor testing args parsing to upper level
yanksyoon Nov 21, 2025
f528f45
refactor: remove environment variable dependency for alternate GitHub…
yanksyoon Nov 21, 2025
2ffb626
chore: apply pflake8 rules to all tests
yanksyoon Nov 21, 2025
ada2718
Merge branch 'chore/cleanup-tests' into feat/pre-job-fork-check
yanksyoon Nov 21, 2025
0e7133d
chore: remove reference to unused env var
yanksyoon Nov 21, 2025
4b56fcd
Merge branch 'chore/cleanup-tests' into feat/pre-job-fork-check
yanksyoon Nov 21, 2025
eb7a72a
Merge branch 'main' into feat/pre-job-fork-check
yanksyoon Nov 26, 2025
03102bb
test: adapt tests to latest GH repository secrets
yanksyoon Nov 27, 2025
ebcffe6
chore: remove integration test requirements.txt
yanksyoon Nov 27, 2025
9e44423
chore: tidy integration test & fail if required params not supplied
yanksyoon Nov 27, 2025
3784ddb
test: update docstring
yanksyoon Nov 27, 2025
4a7030c
ci: install application package before testing
yanksyoon Nov 27, 2025
2f8b0cd
ci: test
yanksyoon Nov 27, 2025
ee2edee
ci: fix secrets mapping
yanksyoon Nov 27, 2025
8ed2ac2
ci: skip heavy testing for debug
yanksyoon Nov 27, 2025
54caba5
ci: debug
yanksyoon Nov 27, 2025
2cf25d9
fix: proxy configuration check
yanksyoon Nov 27, 2025
6c938ad
test: use proxies
yanksyoon Nov 27, 2025
23d0713
test: use proxies in fixtures
yanksyoon Nov 27, 2025
f40df95
test: use test configured flavor/image
yanksyoon Nov 27, 2025
ee73b59
test: application accept 204
yanksyoon Nov 27, 2025
aa7e39d
test: use configurable metrics log path
yanksyoon Nov 27, 2025
4114abe
test: prefer reactive configuration by default for tests
yanksyoon Nov 27, 2025
68f8de6
test: prefer non reactive configuration by default to save deploy com…
yanksyoon Nov 27, 2025
cf571e2
test: remove duplicate health checks (create app health check enabled)
yanksyoon Nov 27, 2025
f5cb83a
test: fix create PR from fork
yanksyoon Nov 27, 2025
ff22f45
test: fix PR base
yanksyoon Nov 27, 2025
d89fd73
test: stepped PR deployment
yanksyoon Nov 27, 2025
3f24503
refactor: remove unused dispatch workflow function and update tests t…
yanksyoon Nov 27, 2025
185dc80
ci: trigger
yanksyoon Nov 27, 2025
9220288
fix: PR base
yanksyoon Nov 27, 2025
376cf5f
test: origina/upstream/fork repository differentiation
yanksyoon Nov 27, 2025
16a5a0c
ci: trigger
yanksyoon Nov 27, 2025
3f3d3e5
test: fix use aproxy configuration by default
yanksyoon Nov 27, 2025
4a47297
test: get all logs from a run
yanksyoon Nov 27, 2025
39c1a3f
test: log cli output
yanksyoon Nov 27, 2025
3f76829
test: fix log assertion
yanksyoon Nov 27, 2025
2f8bbad
ci: remove debug
yanksyoon Nov 27, 2025
f2c46a4
ci: renable charm tests
yanksyoon Nov 27, 2025
2db2abe
fix: lint fixes
yanksyoon Nov 27, 2025
ecd2bda
Merge branch 'main' into feat/pre-job-fork-check
yanksyoon Nov 28, 2025
459b1e8
docs: update allow-external-contributor configuration name
yanksyoon Nov 28, 2025
00817b2
ci: revert debug test
yanksyoon Nov 28, 2025
6a3a4fc
Merge branch 'feat/pre-job-fork-check' of https://github.com/canonica…
yanksyoon Nov 28, 2025
be8ab20
test: revert subdir tests per-file-ignores settings
yanksyoon Nov 28, 2025
b5b39a9
test: fix syntax err
yanksyoon Nov 28, 2025
9ea9786
test: add openstack user/project domain name
yanksyoon Nov 28, 2025
85574bb
test: add openstack user/project domain name
yanksyoon Nov 28, 2025
fbeb9d6
test: add openstack user/project domain name
yanksyoon Nov 28, 2025
6d97fae
test: add openstack cleanup fixture
yanksyoon Nov 28, 2025
1e764f5
test: remove runtime hook
yanksyoon Nov 28, 2025
35fb1d2
Merge branch 'main' into feat/pre-job-fork-check
yanksyoon Nov 28, 2025
ee17ea1
Merge remote-tracking branch 'origin' into feat/pre-job-fork-check
yanksyoon Nov 30, 2025
461744d
feat: flush runners on external contributor config change
yanksyoon Nov 30, 2025
62ea95a
feat: add allow_external_contributor to stored state
yanksyoon Nov 30, 2025
33d49e6
chore: increment app version & docs: update changelog
yanksyoon Nov 30, 2025
c323b96
fix: use stored state
yanksyoon Dec 1, 2025
30dc913
fix: only check user association for pull_request events
yanksyoon Dec 1, 2025
1a1a037
chore: whitespace for concatenated string
yanksyoon Dec 1, 2025
dadbf41
revert removed whitespace from test fixture docstring
yanksyoon Dec 1, 2025
9886120
Merge branch 'main' into feat/pre-job-fork-check
yanksyoon Dec 1, 2025
f51a1f4
feat: check all events that can be triggered by external contributors
yanksyoon Dec 1, 2025
cf54f91
chore: eject repo-policy-compliance
yanksyoon Dec 1, 2025
f4b381e
test: eject repo policy configs
yanksyoon Dec 1, 2025
eb8eb5b
docs: replace repo-policy docs w/ allow-external-contributor
yanksyoon Dec 2, 2025
2257373
chore: introduce external-contributor-check-failure to metrics
yanksyoon Dec 2, 2025
86e6e0d
Merge remote-tracking branch 'origin' into chore/eject-repo-policy-co…
yanksyoon Dec 2, 2025
6946e3b
chore: deprecation related changes
yanksyoon Dec 3, 2025
f166696
Enhance author association checks for internal PRs and streamline eve…
yanksyoon Dec 9, 2025
3e239c6
docs: improve docs & remove extra statements
yanksyoon Dec 9, 2025
0b65ae2
feat: issue metrics on allow_external_contributor check failure
yanksyoon Dec 9, 2025
445f252
chore: clean up comments
yanksyoon Dec 9, 2025
86ba951
test: lint fixes
yanksyoon Dec 9, 2025
15d7e07
Merge conflict fix
yanksyoon Dec 9, 2025
258789e
ci: remove removed test
yanksyoon Dec 9, 2025
d6d3cde
doc: fix doc links
yanksyoon Dec 10, 2025
c94f60a
doc: fix vale suggestions
yanksyoon Dec 10, 2025
18ac204
fix: link
yanksyoon Dec 10, 2025
8ff827c
docs: improve docs
yanksyoon Dec 11, 2025
157d269
docs: revert all lxd doc changes
yanksyoon Dec 11, 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
2 changes: 1 addition & 1 deletion .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
juju-channel: 3.6/stable
provider: lxd
test-tox-env: integration-juju3.6
modules: '["test_charm_metrics_failure", "test_charm_metrics_success", "test_charm_fork_repo", "test_charm_fork_path_change", "test_charm_no_runner", "test_charm_runner", "test_debug_ssh", "test_charm_upgrade", "test_reactive"]'
modules: '["test_charm_metrics_failure", "test_charm_metrics_success", "test_charm_fork_path_change", "test_charm_no_runner", "test_charm_runner", "test_debug_ssh", "test_charm_upgrade", "test_reactive"]'
# INTEGRATION_TOKEN, INTEGRATION_TOKEN_ALT, OS_* are passed through INTEGRATION_TEST_SECRET_ENV_VALUE_<N>
# mapping. See CONTRIBUTING.md for more details.
extra-arguments: |
Expand Down
7 changes: 0 additions & 7 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ options:
Minutes between each reconciliation of the current runners state and their targeted state.
On reconciliation, the charm polls the state of runners and see if actions are needed. The
value should be kept low, unless Github API rate limiting is encountered.
repo-policy-compliance-token:
type: string
description: >-
DEPRECATED, please use allow-external-contributor configuration option instead.
The token to authenticate with the repository-policy-compliance service in order to
generate one-time-tokens. This option requires the repo-policy-compliance-url to be set.
If not set, the repository-policy-compliance service will not be used.
repo-policy-compliance-url:
type: string
description: >-
Expand Down
33 changes: 17 additions & 16 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

This changelog documents user-relevant changes to the GitHub runner charm.

## 2025-12-09

- Deprecate `repo-policy-compliance` service.

## 2025-12-05

- Modified pre-job script to distinguish between internal PRs and fork PRs when applying author association checks. Internal PRs (where head and base repositories match) now skip the author association check, allowing team members to run workflows on their internal branches. Fork PRs continue to enforce OWNER/MEMBER/COLLABORATOR requirements for security.

## 2025-12-01

- Added timeouts to API calls (Openstack,GitHub,Repo policy compliance) to fix a hanging GitHub runner manager application.
- Added timeouts to API calls (Openstack,GitHub,Repo policy compliance) to fix a hanging GitHub runner manager application.

Check failure on line 15 in docs/changelog.md

View workflow job for this annotation

GitHub Actions / docs-checks / vale

[vale] reported by reviewdog 🐶 [Canonical.005-Industry-product-names] Use 'OpenStack' instead of 'Openstack' Raw Output: {"message": "[Canonical.005-Industry-product-names] Use 'OpenStack' instead of 'Openstack'", "location": {"path": "docs/changelog.md", "range": {"start": {"line": 15, "column": 32}}}, "severity": "ERROR"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Added timeouts to API calls (Openstack,GitHub,Repo policy compliance) to fix a hanging GitHub runner manager application.
- Added timeouts to API calls (OpenStack, GitHub, Repo policy compliance) to fix a hanging GitHub runner manager application.

To make Vale happy


## 2025-11-30

Expand Down Expand Up @@ -39,7 +43,6 @@

- Fix issue with scaling down overshooting in deleting runners after cleanup


## 2025-08-20

- Document relevant log files.
Expand Down Expand Up @@ -72,7 +75,7 @@
## 2025-07-09

- Specify max supported nova compute API to be 2.91. This fixes an issue where the charm could fail
due to a bug on the OpenStack side: https://bugs.launchpad.net/nova/+bug/2095364
due to a bug on the OpenStack side: https://bugs.launchpad.net/nova/+bug/2095364

### 2025-06-30

Expand All @@ -92,8 +95,7 @@
### 2025-06-16

- Revert `copytruncate logrotate` method for reactive processes, as `copytruncate` keeps log files on disks and does not remove them, and each process is writing to a new file leading to a huge and increasing amount
of zero sized files in the reactive log directory. This is a temporary fix until a better solution is implemented, as it has the downside that long lived reactive processes may write to deleted log files.

of zero sized files in the reactive log directory. This is a temporary fix until a better solution is implemented, as it has the downside that long lived reactive processes may write to deleted log files.

### 2025-06-12

Expand All @@ -105,9 +107,9 @@

### 2025-06-04

- Reduce the reconcile-interval configuration from 10 minutes to 5 minutes. This is the interval
between reconciling the current and intended number of runners. The value should be kept low,
unless GitHub API rate limiting is encountered.
- Reduce the reconcile-interval configuration from 10 minutes to 5 minutes. This is the interval

Check warning on line 110 in docs/changelog.md

View workflow job for this annotation

GitHub Actions / docs-checks / vale

[vale] reported by reviewdog 🐶 [Canonical.013-Spell-out-numbers-below-10] Consider using 'five' instead of '5' Raw Output: {"message": "[Canonical.013-Spell-out-numbers-below-10] Consider using 'five' instead of '5'", "location": {"path": "docs/changelog.md", "range": {"start": {"line": 110, "column": 66}}}, "severity": "WARNING"}
between reconciling the current and intended number of runners. The value should be kept low,
unless GitHub API rate limiting is encountered.
- Removed the reconcile-runners Juju action.

### 2025-06-03
Expand All @@ -116,9 +118,8 @@

### 2025-05-22

- Add possibility to run a script in the pre-job phase of a runner. This can be useful to setup
network/infrastructure specific things.

- Add possibility to run a script in the pre-job phase of a runner. This can be useful to setup
network/infrastructure specific things.

### 2025-05-09

Expand All @@ -127,8 +128,8 @@
### 2025-05-06

- The ssh health checks are removed and GitHub is used instead to get the runners health
information. This implies many changes in both the structure of the project and its functionality. Potentially, many race conditions should
disappear.
information. This implies many changes in both the structure of the project and its functionality. Potentially, many race conditions should
disappear.

### 2025-04-28

Expand Down Expand Up @@ -162,7 +163,7 @@
### 2025-03-24

- New terraform product module. This module is composed of one github-runner-image-builder application and the related
github-runner applications.
github-runner applications.

### 2024-12-13

Expand Down Expand Up @@ -208,14 +209,14 @@
### 2024-10-17

- Use in-memory authentication instead of clouds.yaml on disk for OpenStack. This prevents
the multi-processing fighting over the file handle for the clouds.yaml file in the `github-runner-manager`.
the multi-processing fighting over the file handle for the clouds.yaml file in the `github-runner-manager`.

- Fixed a bug where metrics storage for unmatched runners could not get cleaned up.

### 2024-10-11

- Added support for COS integration with reactive runners.
- The charm now creates a dedicated user which is used for running the reactive process and
- The charm now creates a dedicated user which is used for running the reactive process and
storing metrics and ssh keys (also for non-reactive mode).

### 2024-10-07
Expand Down
23 changes: 16 additions & 7 deletions docs/explanation/charm-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Conceptually, the charm can be divided into the following:
- Management of the virtual machine image
- Management of the network
- GitHub API usage
- Management of [Python web service for checking GitHub repository settings](https://github.com/canonical/repo-policy-compliance)
- Management of dependencies

# Description of the charm's main components
Expand Down Expand Up @@ -112,18 +111,28 @@ The charm requires a GitHub personal access token for the [`token` configuration
- Requesting a list of self-hosted runners configured in an organization or repository
- Deleting self-hosted runners

The token is also passed to [repo-policy-compliance](https://github.com/canonical/repo-policy-compliance) to access GitHub API for the service.

Note that the GitHub API uses a [rate-limiting mechanism](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28). When this is reached, the charm may not be able to perform the necessary operations and may go into
BlockedStatus. The charm will automatically recover from this state once the rate limit is reset, but using a different token with a higher rate limit may be a better solution depending on your deployment requirements.

<!-- vale Canonical.007-Headings-sentence-case = NO -->
## GitHub repository setting check
## External contributor access control
<!-- vale Canonical.007-Headings-sentence-case = YES -->

The [repo-policy-compliance](https://github.com/canonical/repo-policy-compliance) is a [Flask application](https://flask.palletsprojects.com/) hosted on [Gunicorn](https://gunicorn.org/) that provides a RESTful HTTP API to check the settings of GitHub repositories. This ensures the GitHub repository settings do not allow the execution of code not reviewed by maintainers on the self-hosted runners.

Using the [pre-job script](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/running-scripts-before-or-after-a-job#about-pre--and-post-job-scripts), the self-hosted runners call the Python web service to check if the GitHub repository settings for the job are compliant. If not compliant, it will output an error message and force stop the runner to prevent code from being executed.
The charm provides security controls for managing external contributor access through the `allow-external-contributor` configuration option.
External contributors are defined as users not in COLLABORATOR, MEMBER, or OWNER status. For
example, pull requests from fork repositories from users not in COLLABORATOR, MEMBER or OWNER
status would be considered requests from an external contributor. Internal requests such as
an internal PR from a renovate bot account would not be considered an event from an external
contributor.
When set to `false`, the charm restricts workflow execution to external contributors for the following GitHub events:

- `pull_request` - Pull requests from external contributors
- `pull_request_target` - Pull request targeting (designed for handling PRs from forks)
- `pull_request_review` - Pull request reviews from external contributors
- `pull_request_review_comment` - Comments on pull request diffs from external contributors
- `issue_comment` - Comments on issues or pull requests from external contributors

Using the [pre-job script](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/running-scripts-before-or-after-a-job#about-pre--and-post-job-scripts), the self-hosted runners check the author association of the user triggering the workflow. If the user does not have sufficient permissions, the runner will output an error message and stop execution to prevent unauthorized code from running.

## COS integration
Upon integration through the `cos-agent`, the charm initiates the logging of specific metric events
Expand Down
5 changes: 3 additions & 2 deletions docs/explanation/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

The charm manages GitHub self-hosted runners to run GitHub Actions jobs. This allows users on GitHub to execute code on the servers hosting the runners, which poses a remote code execution risk if the code is not trusted. Therefore, the charm should only spawn runners to trusted organizations or repositories.

For third-party contributions, the charm can integrate with the [Repo Policy Compliance charm](https://charmhub.io/repo-policy-compliance) to manage the repository policy. With this integration, the self-hosted runner will not execute the GitHub jobs if the policy is not met. See [working with outside collaborators](https://charmhub.io/github-runner/docs/how-to-comply-security#working-with-outside-collaborators) for the recommended settings to ensure the code is reviewed by a trusted user prior to execution in the runner.
For external contributor security, see [How to manage external contributors securely](../how-to/manage-external-contributors.md) for configuration options and recommended practices.

### Good practices

- Only register the GitHub self-hosted runners to a trusted organization or repository so that only workflows from trusted users are able to run on the runners.
- For outside collaborators: Use the [`repo-policy-compliance` charm](https://charmhub.io/repo-policy-compliance) with [policy for outside collaborators](https://charmhub.io/github-runner/docs/how-to-comply-security#working-with-outside-collaborators) to ensure the code executed in runners are reviewed by a trusted user.
- For outside collaborators: Use the `allow-external-contributor` configuration option (set to `false`) to restrict workflow execution to users with COLLABORATOR, MEMBER, or OWNER status. This prevents unauthorized code execution from untrusted external contributors.

Check failure on line 14 in docs/explanation/security.md

View workflow job for this annotation

GitHub Actions / docs-checks / vale

[vale] reported by reviewdog 🐶 [Canonical.000-US-spellcheck] The word 'untrusted' seems to be misspelled. Raw Output: {"message": "[Canonical.000-US-spellcheck] The word 'untrusted' seems to be misspelled.", "location": {"path": "docs/explanation/security.md", "range": {"start": {"line": 14, "column": 236}}}, "severity": "ERROR"}

Check warning on line 14 in docs/explanation/security.md

View workflow job for this annotation

GitHub Actions / docs-checks / vale

[vale] reported by reviewdog 🐶 [Canonical.500-Repeated-words] 'to' is repeated! Raw Output: {"message": "[Canonical.500-Repeated-words] 'to' is repeated!", "location": {"path": "docs/explanation/security.md", "range": {"start": {"line": 14, "column": 1}}}, "severity": "WARNING"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like "untrusted" has made Vale unhappy, I recommend adding it to accept.txt

- Configure appropriate repository settings and protection rules to ensure the code executed in runners are reviewed by a trusted user.

## Permission for GitHub app or personal access token

Expand Down
34 changes: 31 additions & 3 deletions docs/how-to/comply-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,29 @@

According to GitHub, running code inside the GitHub self-hosted runner [poses a significant security risk of arbitrary code execution](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#self-hosted-runner-security). The self-hosted runners managed by the charm are isolated in its own single-use virtual machine instance. In addition, the charm enforces some repository settings to ensure all code running on the self-hosted runners is reviewed by someone trusted.

The charm can be integrated with the [Repo Policy Compliance charm](https://charmhub.io/repo-policy-compliance) to enforce a set of good practices around GitHub repository settings. Self-hosted runners managed by the charm will not run jobs on repositories unless they are compliant with the practices.
The charm provides the `allow-external-contributor` configuration option to control whether workflows triggered by external contributors can execute on the self-hosted runners. When set to `false`, only users with COLLABORATOR, MEMBER, or OWNER status can trigger workflows from pull requests, reviews, and comments.

In this guide, a recommended set of policies will be presented.
In this guide, a recommended set of policies and security practices will be presented.

## External contributor access control

Configure the charm to restrict external contributor access:

```bash
juju config github-runner allow-external-contributor=false
```

With this setting, workflows will only run for users with the following GitHub author associations:
- `OWNER` - Repository or organization owners
- `MEMBER` - Organization members
- `COLLABORATOR` - Users with explicit collaborator access
Comment on lines +18 to +20
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `OWNER` - Repository or organization owners
- `MEMBER` - Organization members
- `COLLABORATOR` - Users with explicit collaborator access
- OWNER - Repository or organization owners
- MEMBER - Organization members
- COLLABORATOR - Users with explicit collaborator access

To be consistent with the rest of the documentation


The charm checks author associations for these events:
- `pull_request` - Pull requests from external contributors
- `pull_request_target` - Pull request targeting (designed for handling PRs from forks)
- `pull_request_review` - Pull request reviews from external contributors
- `pull_request_review_comment` - Comments on pull request diffs from external contributors
- `issue_comment` - Comments on issues or pull requests from external contributors

## Recommended policy

Expand All @@ -20,4 +40,12 @@

### Working with outside collaborators

Generally, outside collaborators are not completely trusted, but still would need to contribute in some manner. As such, this charm requires pull requests by outside collaborators to be reviewed by someone with `write` permission or above. Once the review is completed, the reviewer should add a comment including the following string: `/canonical/self-hosted-runners/run-workflows <commit SHA>`, where `<commit SHA>` is the commit SHA of the approved commit. Once posted, the self-hosted runners will run the workflow for this commit.
When `allow-external-contributor` is set to `false`, outside collaborators can still contribute through the following secure workflow:

1. External contributors create pull requests as usual
2. A repository maintainer with COLLABORATOR, MEMBER, or OWNER status reviews the code
3. If the code is safe, the maintainer can:
- Approve and merge the pull request to another branch (workflows will run with the maintainer's permissions)

Check failure on line 48 in docs/how-to/comply-security.md

View workflow job for this annotation

GitHub Actions / docs-checks / vale

[vale] reported by reviewdog 🐶 [Canonical.000-US-spellcheck] The word 'maintainer's' seems to be misspelled. Raw Output: {"message": "[Canonical.000-US-spellcheck] The word 'maintainer's' seems to be misspelled.", "location": {"path": "docs/how-to/comply-security.md", "range": {"start": {"line": 48, "column": 87}}}, "severity": "ERROR"}
Copy link
Contributor

Choose a reason for hiding this comment

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

maintainer's is another word to add to accept.txt, unless you want to work around it:

Suggested change
- Approve and merge the pull request to another branch (workflows will run with the maintainer's permissions)
- Approve and merge the pull request to another branch (workflows will run with the permissions of the maintainer)

- Manually trigger workflow runs if needed (using workflow dispatch on the target branch)

This approach ensures that all code from external contributors is reviewed by trusted users before execution on self-hosted runners, eliminating the need for manual comment-based approval workflows.
Loading
Loading