@@ -10,7 +10,7 @@ R console:
10
10
11
11
``` r
12
12
# Install/Update sandpaper
13
- options(repos = c(carpentries = " https://carpentries.r-universe.dev/" ,
13
+ options(repos = c(carpentries = " https://carpentries.r-universe.dev/" ,
14
14
CRAN = " https://cloud.r-project.org" ))
15
15
install.packages(" sandpaper" )
16
16
@@ -42,13 +42,13 @@ This workflow does the following:
42
42
43
43
#### Caching
44
44
45
- This workflow has two caches; one cache is for the lesson infrastructure and
45
+ This workflow has two caches; one cache is for the lesson infrastructure and
46
46
the other is for the lesson dependencies if the lesson contains rendered
47
47
content. These caches are invalidated by new versions of the infrastructure and
48
- the ` renv.lock ` file, respectively. If there is a problem with the cache,
48
+ the ` renv.lock ` file, respectively. If there is a problem with the cache,
49
49
manual invaliation is necessary. You will need maintain access to the repository
50
50
and you can either go to the actions tab and [ click on the caches button to find
51
- and invalidate the failing cache] ( https://github.blog/changelog/2022-10-20-manage-caches-in-your-actions-workflows-from-web-interface/ )
51
+ and invalidate the failing cache] ( https://github.blog/changelog/2022-10-20-manage-caches-in-your-actions-workflows-from-web-interface/ )
52
52
or by setting the ` CACHE_VERSION ` secret to the current date (which will
53
53
invalidate all of the caches).
54
54
@@ -58,32 +58,32 @@ invalidate all of the caches).
58
58
59
59
These workflows run on a schedule and at the maintainer's request. Because they
60
60
create pull requests that update workflows/require the downstream actions to run,
61
- they need a special repository/organization secret token called
62
- ` SANDPAPER_WORKFLOW ` and it must have the ` public_repo ` and ` workflow ` scope.
61
+ they need a special repository/organization secret token called
62
+ ` SANDPAPER_WORKFLOW ` and it must have the ` public_repo ` and ` workflow ` scope.
63
63
64
64
This can be an individual user token, OR it can be a trusted bot account. If you
65
65
have a repository in one of the official Carpentries accounts, then you do not
66
66
need to worry about this token being present because the Carpentries Core Team
67
67
will take care of supplying this token.
68
68
69
- If you want to use your personal account: you can go to
69
+ If you want to use your personal account: you can go to
70
70
< https://github.com/settings/tokens/new?scopes=public_repo,workflow&description=Sandpaper%20Token >
71
71
to create a token. Once you have created your token, you should copy it to your
72
72
clipboard and then go to your repository's settings > secrets > actions and
73
73
create or edit the ` SANDPAPER_WORKFLOW ` secret, pasting in the generated token.
74
74
75
75
If you do not specify your token correctly, the runs will not fail and they will
76
- give you instructions to provide the token for your repository.
76
+ give you instructions to provide the token for your repository.
77
77
78
78
### 02 Maintain: Update Workflow Files (update-workflow.yaml)
79
79
80
- The {sandpaper} repository was designed to do as much as possible to separate
81
- the tools from the content. For local builds, this is absolutely true, but
82
- there is a minor issue when it comes to workflow files: they must live inside
83
- the repository.
80
+ The {sandpaper} repository was designed to do as much as possible to separate
81
+ the tools from the content. For local builds, this is absolutely true, but
82
+ there is a minor issue when it comes to workflow files: they must live inside
83
+ the repository.
84
84
85
85
This workflow ensures that the workflow files are up-to-date. The way it work is
86
- to download the update-workflows.sh script from GitHub and run it. The script
86
+ to download the update-workflows.sh script from GitHub and run it. The script
87
87
will do the following:
88
88
89
89
1 . check the recorded version of sandpaper against the current version on github
@@ -100,25 +100,25 @@ This update is run weekly or on demand.
100
100
101
101
For lessons that have generated content, we use {renv} to ensure that the output
102
102
is stable. This is controlled by a single lockfile which documents the packages
103
- needed for the lesson and the version numbers. This workflow is skipped in
103
+ needed for the lesson and the version numbers. This workflow is skipped in
104
104
lessons that do not have generated content.
105
105
106
106
Because the lessons need to remain current with the package ecosystem, it's a
107
- good idea to make sure these packages can be updated periodically. The
107
+ good idea to make sure these packages can be updated periodically. The
108
108
update cache workflow will do this by checking for updates, applying them in a
109
109
branch called ` updates/packages ` and creating a pull request with _ only the
110
- lockfile changed_ .
110
+ lockfile changed_ .
111
111
112
112
From here, the markdown documents will be rebuilt and you can inspect what has
113
- changed based on how the packages have updated.
113
+ changed based on how the packages have updated.
114
114
115
115
## Pull Request and Review Management
116
116
117
117
Because our lessons execute code, pull requests are a secruity risk for any
118
118
lesson and thus have security measures associted with them. ** Do not merge any
119
119
pull requests that do not pass checks and do not have bots commented on them.**
120
120
121
- This series of workflows all go together and are described in the following
121
+ This series of workflows all go together and are described in the following
122
122
diagram and the below sections:
123
123
124
124
![ Graph representation of a pull request] ( https://carpentries.github.io/sandpaper/articles/img/pr-flow.dot.svg )
@@ -129,15 +129,15 @@ This workflow runs every time a pull request is created and its purpose is to
129
129
validate that the pull request is okay to run. This means the following things:
130
130
131
131
1 . The pull request does not contain modified workflow files
132
- 2 . If the pull request contains modified workflow files, it does not contain
132
+ 2 . If the pull request contains modified workflow files, it does not contain
133
133
modified content files (such as a situation where @carpentries-bot will
134
134
make an automated pull request)
135
135
3 . The pull request does not contain an invalid commit hash (e.g. from a fork
136
136
that was made before a lesson was transitioned from styles to use the
137
137
workbench).
138
138
139
- Once the checks are finished, a comment is issued to the pull request, which
140
- will allow maintainers to determine if it is safe to run the
139
+ Once the checks are finished, a comment is issued to the pull request, which
140
+ will allow maintainers to determine if it is safe to run the
141
141
"Receive Pull Request" workflow from new contributors.
142
142
143
143
### Receive Pull Request (pr-receive.yaml)
@@ -154,7 +154,7 @@ started.
154
154
155
155
The first step of this workflow is to check if it is valid (e.g. that no
156
156
workflow files have been modified). If there are workflow files that have been
157
- modified, a comment is made that indicates that the workflow is not run. If
157
+ modified, a comment is made that indicates that the workflow is not run. If
158
158
both a workflow file and lesson content is modified, an error will occurr.
159
159
160
160
The second step (if valid) is to build the generated content from the pull
@@ -164,7 +164,7 @@ request. This builds the content and uploads three artifacts:
164
164
2 . A summary of changes after the rendering process (diff)
165
165
3 . The rendered files (build)
166
166
167
- Because this workflow builds generated content, it follows the same general
167
+ Because this workflow builds generated content, it follows the same general
168
168
process as the ` sandpaper-main ` workflow with the same caching mechanisms.
169
169
170
170
The artifacts produced are used by the next workflow.
@@ -183,9 +183,9 @@ The steps in this workflow are:
183
183
Importantly: if the pull request is invalid, the branch is not created so any
184
184
malicious code is not published.
185
185
186
- From here, the maintainer can request changes from the author and eventually
187
- either merge or reject the PR. When this happens, if the PR was valid, the
188
- preview branch needs to be deleted.
186
+ From here, the maintainer can request changes from the author and eventually
187
+ either merge or reject the PR. When this happens, if the PR was valid, the
188
+ preview branch needs to be deleted.
189
189
190
190
### Send Close PR Signal (pr-close-signal.yaml)
191
191
0 commit comments