@@ -9,11 +9,11 @@ This document contains a list of guidelines and best practices to use when
9
9
working on LLVM's CI systems. These are intended to keep our actions reliable,
10
10
consistent, and secure.
11
11
12
- Github Actions Best Practices
12
+ GitHub Actions Best Practices
13
13
=============================
14
14
15
15
This section contains information on best practices/guidelines when working on
16
- LLVM's github actions workflows.
16
+ LLVM's GitHub actions workflows.
17
17
18
18
Disabling Jobs In Forks
19
19
-----------------------
@@ -35,7 +35,7 @@ jobs specified within a workflow:
35
35
if : github.repository_owner == 'llvm'
36
36
37
37
We choose to use ``github.repository_owner `` rather than ``github.repository ``
38
- to enable these workflows to run in forks inside the LLVM organization such as
38
+ to enable these workflows to run in forks inside the LLVM organization, such as
39
39
the ClangIR fork.
40
40
41
41
There are some exceptions to this rule where ``github.repository `` might be
@@ -46,7 +46,7 @@ release tasks, which should not run anywhere else.
46
46
Hash Pinning Dependencies
47
47
-------------------------
48
48
49
- Github Actions allows the use of actions from other repositories as steps in
49
+ GitHub Actions allows the use of actions from other repositories as steps in
50
50
jobs. We take advantage of various actions for a variety of different tasks,
51
51
but especially tasks like checking out the repository, and
52
52
downloading/uploading build caches. These actions are typically versioned with
@@ -59,9 +59,9 @@ just a release, which looks like the following:
59
59
uses : actions/checkout@v4
60
60
61
61
However, it is best practice to specify an exact commit SHA from which to pull
62
- the action from , noting the version in a comment:
62
+ the action, noting the version in a comment:
63
63
64
- We plan on revisiting this recommendation once Github 's immutable actions have
64
+ We plan on revisiting this recommendation once GitHub 's immutable actions have
65
65
been rolled out as GA.
66
66
67
67
.. code-block :: yaml
@@ -72,22 +72,22 @@ been rolled out as GA.
72
72
73
73
This is beneficial for two reasons: reliability and security. Specifying an
74
74
exact SHA rather than just a major version ensures we end up running the same
75
- action originally specified when the workflow as authored and/or updated,
75
+ action originally specified when the workflow was authored and/or updated,
76
76
and that no breaking changes sneak in from new versions of a workflow being
77
77
released. However, this effect could also be achieved by specifying an exact
78
78
dot release. The biggest reason to prefer hash pinned dependencies is security.
79
- Release assets on Github are mutable, allowing an attacker to change the code
79
+ Release assets on GitHub are mutable, allowing an attacker to change the code
80
80
within a specific version of an action after the fact, potentially stealing
81
81
sensitive tokens and credentials. Hash pinning the dependencies prevents this
82
82
as the hash would change with the code.
83
83
84
84
Using Versioned Runner Images
85
85
-----------------------------
86
86
87
- Github actions allows the use of either specifically versioned runner images
87
+ GitHub actions allows the use of either specifically versioned runner images
88
88
(e.g., ``ubuntu-22.04 ``), or just the latest runner image
89
89
(e.g., ``ubuntu-latest ``). It is best practice to use explicitly versioned
90
- runner images. This prevents breakages when Github rolls the latest runner
90
+ runner images. This prevents breakages when GitHub rolls the latest runner
91
91
image to a new version with potentially breaking changes, instead allowing us
92
92
to explicitly opt-in to using the new image when we have done sufficient
93
93
testing to ensure that our existing workflows work as expected in the new
@@ -112,7 +112,7 @@ the principle of least privilege.
112
112
Ensuring Workflows Run on the Correct Events
113
113
--------------------------------------------
114
114
115
- Github allows workflows to run on a multitude of events and it is important to
115
+ GitHub allows workflows to run on a multitude of events, and it is important to
116
116
configure a workflow such that it triggers on the correct events. There are
117
117
two main best practices around events that trigger workflows:
118
118
0 commit comments