Skip to content

Commit bedc637

Browse files
authored
Add disclaimer + improve security for third party actions (#20227)
1 parent cdf6baa commit bedc637

22 files changed

+158
-131
lines changed

content/actions/guides/adding-labels-to-issues.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ topics:
1616
{% data reusables.actions.enterprise-github-hosted-runners %}
1717
{% data reusables.actions.ae-beta %}
1818
{% data reusables.actions.ae-self-hosted-runners-notice %}
19+
{% data reusables.actions.actions-not-certified-by-github-note %}
1920

2021
## Introduction
2122

@@ -30,6 +31,8 @@ In the tutorial, you will first make a workflow file that uses the [`andymckay/l
3031
3. Copy the following YAML contents into your workflow file.
3132

3233
```yaml{:copy}
34+
{% indented_data_reference reusables.actions.actions-not-certified-by-github-comment spaces=4 %}
35+
3336
name: Label issues
3437
on:
3538
issues:
@@ -43,7 +46,7 @@ In the tutorial, you will first make a workflow file that uses the [`andymckay/l
4346
issues: write{% endif %}
4447
steps:
4548
- name: Label issues
46-
uses: andymckay/labeler@1.0.2
49+
uses: andymckay/labeler@5c59dabdfd4dd5bd9c6e6d255b01b9d764af4414
4750
with:
4851
add-labels: "triage"
4952
repo-token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}

content/actions/guides/building-and-testing-java-with-gradle.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ shortTitle: Build & test Java & Gradle
1919
{% data reusables.actions.enterprise-beta %}
2020
{% data reusables.actions.enterprise-github-hosted-runners %}
2121
{% data reusables.actions.ae-beta %}
22+
{% data reusables.actions.actions-not-certified-by-github-note %}
2223

2324
## Introduction
2425

@@ -47,8 +48,9 @@ To get started quickly, you can choose the preconfigured Gradle template when yo
4748

4849
You can also add this workflow manually by creating a new file in the `.github/workflows` directory of your repository.
4950

50-
{% raw %}
5151
```yaml{:copy}
52+
{% data reusables.actions.actions-not-certified-by-github-comment %}
53+
5254
name: Java CI
5355
5456
on: [push]
@@ -65,11 +67,10 @@ jobs:
6567
java-version: '11'
6668
distribution: 'adopt'
6769
- name: Validate Gradle wrapper
68-
uses: gradle/wrapper-validation-action@v1
70+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
6971
- name: Build with Gradle
7072
run: ./gradlew build
7173
```
72-
{% endraw %}
7374

7475
This workflow performs the following steps:
7576

@@ -101,7 +102,7 @@ steps:
101102
java-version: '11'
102103
distribution: 'adopt'
103104
- name: Validate Gradle wrapper
104-
uses: gradle/wrapper-validation-action@v1
105+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
105106
- name: Run the Gradle package task
106107
run: ./gradlew -b ci.gradle package
107108
```
@@ -121,7 +122,7 @@ steps:
121122
java-version: '11'
122123
distribution: 'adopt'
123124
- name: Validate Gradle wrapper
124-
uses: gradle/wrapper-validation-action@v1
125+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
125126
- name: Cache Gradle packages
126127
uses: actions/cache@v2
127128
with:
@@ -159,7 +160,7 @@ steps:
159160
java-version: '11'
160161
distribution: 'adopt'
161162
- name: Validate Gradle wrapper
162-
uses: gradle/wrapper-validation-action@v1
163+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
163164
- run: ./gradlew build
164165
- uses: actions/upload-artifact@v2
165166
with:

content/actions/guides/building-and-testing-python.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ shortTitle: Build & test Python
1818
{% data reusables.actions.enterprise-beta %}
1919
{% data reusables.actions.enterprise-github-hosted-runners %}
2020
{% data reusables.actions.ae-beta %}
21+
{% data reusables.actions.actions-not-certified-by-github-note %}
2122

2223
## Introduction
2324

@@ -402,12 +403,8 @@ You can configure your workflow to publish your Python package to a package regi
402403

403404
For this example, you will need to create two [PyPI API tokens](https://pypi.org/help/#apitoken). You can use secrets to store the access tokens or credentials needed to publish your package. For more information, see "[Creating and using encrypted secrets](/github/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
404405

405-
{% raw %}
406406
```yaml{:copy}
407-
# This workflow uses actions that are not certified by GitHub.
408-
# They are provided by a third-party and are governed by
409-
# separate terms of service, privacy policy, and support
410-
# documentation.
407+
{% data reusables.actions.actions-not-certified-by-github-comment %}
411408
412409
name: Upload Python Package
413410
@@ -434,8 +431,7 @@ jobs:
434431
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
435432
with:
436433
user: __token__
437-
password: ${{ secrets.PYPI_API_TOKEN }}
434+
password: {% raw %}${{ secrets.PYPI_API_TOKEN }}{% endraw %}
438435
```
439-
{% endraw %}
440436

441437
For more information about the template workflow, see [`python-publish`](https://github.com/actions/starter-workflows/blob/main/ci/python-publish.yml).

content/actions/guides/building-and-testing-ruby.md

+23-21
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ topics:
1515
{% data reusables.actions.enterprise-beta %}
1616
{% data reusables.actions.enterprise-github-hosted-runners %}
1717
{% data reusables.actions.ae-beta %}
18+
{% data reusables.actions.actions-not-certified-by-github-note %}
1819

1920
## Introduction
2021

@@ -33,8 +34,9 @@ We recommend that you have a basic understanding of Ruby, YAML, workflow configu
3334

3435
To get started quickly, add the template to the `.github/workflows` directory of your repository. The workflow shown below assumes that the default branch for your repository is `main`.
3536

36-
{% raw %}
3737
```yaml
38+
{% data reusables.actions.actions-not-certified-by-github-comment %}
39+
3840
name: Ruby
3941

4042
on:
@@ -51,15 +53,14 @@ jobs:
5153
steps:
5254
- uses: actions/checkout@v2
5355
- name: Set up Ruby
54-
uses: ruby/setup-ruby@v1
56+
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
5557
with:
5658
ruby-version: 2.6
5759
- name: Install dependencies
5860
run: bundle install
5961
- name: Run tests
6062
run: bundle exec rake
6163
```
62-
{% endraw %}
6364
6465
## Specifying the Ruby version
6566
@@ -73,7 +74,7 @@ The `setup-ruby` action takes a Ruby version as an input and configures that ver
7374
```yaml
7475
steps:
7576
- uses: actions/checkout@v2
76-
- uses: ruby/setup-ruby@v1
77+
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
7778
with:
7879
ruby-version: 2.6 # Not needed with a .ruby-version file
7980
- run: bundle install
@@ -99,8 +100,9 @@ Each version of Ruby specified in the `ruby-version` array creates a job that ru
99100

100101
The full updated workflow with a matrix strategy could look like this:
101102

102-
{% raw %}
103103
```yaml
104+
{% data reusables.actions.actions-not-certified-by-github-comment %}
105+
104106
name: Ruby CI
105107
106108
on:
@@ -120,16 +122,15 @@ jobs:
120122
121123
steps:
122124
- uses: actions/checkout@v2
123-
- name: Set up Ruby ${{ matrix.ruby-version }}
124-
uses: ruby/setup-ruby@v1
125+
- name: {% raw %}Set up Ruby ${{ matrix.ruby-version }}{% endraw %}
126+
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
125127
with:
126-
ruby-version: ${{ matrix.ruby-version }}
128+
ruby-version: {% raw %}${{ matrix.ruby-version }}{% endraw %}
127129
- name: Install dependencies
128130
run: bundle install
129131
- name: Run tests
130132
run: bundle exec rake
131133
```
132-
{% endraw %}
133134

134135
## Installing dependencies with Bundler
135136

@@ -139,7 +140,7 @@ The `setup-ruby` action will automatically install bundler for you. The version
139140
```yaml
140141
steps:
141142
- uses: actions/checkout@v2
142-
- uses: ruby/setup-ruby@v1
143+
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
143144
with:
144145
ruby-version: 2.6
145146
- run: bundle install
@@ -155,7 +156,7 @@ To enable caching, set the following.
155156
{% raw %}
156157
```yaml
157158
steps:
158-
- uses: ruby/setup-ruby@v1
159+
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
159160
with:
160161
bundler-cache: true
161162
```
@@ -205,8 +206,9 @@ steps:
205206

206207
The following example matrix tests all stable releases and head versions of MRI, JRuby and TruffleRuby on Ubuntu and macOS.
207208

208-
{% raw %}
209209
```yaml
210+
{% data reusables.actions.actions-not-certified-by-github-comment %}
211+
210212
name: Matrix Testing
211213
212214
on:
@@ -217,29 +219,29 @@ on:
217219
218220
jobs:
219221
test:
220-
runs-on: ${{ matrix.os }}-latest
222+
runs-on: {% raw %}${{ matrix.os }}-latest{% endraw %}
221223
strategy:
222224
fail-fast: false
223225
matrix:
224226
os: [ubuntu, macos]
225227
ruby: [2.5, 2.6, 2.7, head, debug, jruby, jruby-head, truffleruby, truffleruby-head]
226-
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
228+
continue-on-error: {% raw %}${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}{% endraw %}
227229
steps:
228230
- uses: actions/checkout@v2
229-
- uses: ruby/setup-ruby@v1
231+
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
230232
with:
231-
ruby-version: ${{ matrix.ruby }}
233+
ruby-version: {% raw %}${{ matrix.ruby }}{% endraw %}
232234
- run: bundle install
233235
- run: bundle exec rake
234236
```
235-
{% endraw %}
236237

237238
## Linting your code
238239

239240
The following example installs `rubocop` and uses it to lint all files. For more information, see [Rubocop](https://github.com/rubocop-hq/rubocop). You can [configure Rubocop](https://docs.rubocop.org/rubocop/configuration.html) to decide on the specific linting rules.
240241

241-
{% raw %}
242242
```yaml
243+
{% data reusables.actions.actions-not-certified-by-github-comment %}
244+
243245
name: Linting
244246
245247
on: [push]
@@ -249,14 +251,13 @@ jobs:
249251
runs-on: ubuntu-latest
250252
steps:
251253
- uses: actions/checkout@v2
252-
- uses: ruby/setup-ruby@v1
254+
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
253255
with:
254256
ruby-version: 2.6
255257
- run: bundle install
256258
- name: Rubocop
257259
run: rubocop
258260
```
259-
{% endraw %}
260261

261262
## Publishing Gems
262263

@@ -265,6 +266,7 @@ You can configure your workflow to publish your Ruby package to any package regi
265266
You can store any access tokens or credentials needed to publish your package using repository secrets. The following example creates and publishes a package to `GitHub Package Registry` and `RubyGems`.
266267

267268
```yaml
269+
{% data reusables.actions.actions-not-certified-by-github-comment %}
268270
269271
name: Ruby Gem
270272
@@ -288,7 +290,7 @@ jobs:
288290
steps:{% raw %}
289291
- uses: actions/checkout@v2
290292
- name: Set up Ruby 2.6
291-
uses: ruby/setup-ruby@v1
293+
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
292294
with:
293295
ruby-version: 2.6
294296
- run: bundle install

content/actions/guides/building-and-testing-swift.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ shortTitle: Build & test Swift
1616
{% data reusables.actions.enterprise-beta %}
1717
{% data reusables.actions.enterprise-github-hosted-runners %}
1818
{% data reusables.actions.ae-beta %}
19+
{% data reusables.actions.actions-not-certified-by-github-note %}
1920

2021
## Introduction
2122

@@ -68,31 +69,31 @@ The examples below demonstrate using the `fwal/setup-swift` action.
6869

6970
You can configure your job to use a multiple versions of Swift in a build matrix.
7071

71-
{% raw %}
7272
```yaml{:copy}
73+
{% data reusables.actions.actions-not-certified-by-github-comment %}
74+
7375
name: Swift
7476
7577
on: [push]
7678
7779
jobs:
7880
build:
79-
name: Swift ${{ matrix.swift }} on ${{ matrix.os }}
81+
name: {% raw %}Swift ${{ matrix.swift }} on ${{ matrix.os }}{% endraw %}
8082
strategy:
8183
matrix:
8284
os: [ubuntu-latest, macos-latest]
8385
swift: ["5.2", "5.3"]
84-
runs-on: ${{ matrix.os }}
86+
runs-on: {% raw %}${{ matrix.os }}{% endraw %}
8587
steps:
86-
- uses: fwal/setup-swift@v1
88+
- uses: fwal/setup-swift@d43a564349d1341cd990cfbd70d94d63b8899475
8789
with:
88-
swift-version: ${{ matrix.swift }}
89-
- uses: actions/checkout@v2
90+
swift-version: {% raw %}${{ matrix.swift }}{% endraw %}
91+
- uses: actions/checkout@
9092
- name: Build
9193
run: swift build
9294
- name: Run tests
9395
run: swift test
9496
```
95-
{% endraw %}
9697

9798
### Using a single specific Swift version
9899

@@ -101,7 +102,7 @@ You can configure your job to use a single specific version of Swift, such as `5
101102
{% raw %}
102103
```yaml{:copy}
103104
steps:
104-
- uses: fwal/setup-swift@v1
105+
- uses: fwal/setup-swift@d43a564349d1341cd990cfbd70d94d63b8899475
105106
with:
106107
swift-version: "5.3.3"
107108
- name: Get swift version
@@ -117,7 +118,7 @@ You can use the same commands that you use locally to build and test your code u
117118
```yaml{:copy}
118119
steps:
119120
- uses: actions/checkout@v2
120-
- uses: fwal/setup-swift@v1
121+
- uses: fwal/setup-swift@d43a564349d1341cd990cfbd70d94d63b8899475
121122
with:
122123
swift-version: "5.3.3"
123124
- name: Build

content/actions/guides/commenting-on-an-issue-when-a-label-is-added.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ shortTitle: Add label to comment on issue
1717
{% data reusables.actions.enterprise-github-hosted-runners %}
1818
{% data reusables.actions.ae-beta %}
1919
{% data reusables.actions.ae-self-hosted-runners-notice %}
20+
{% data reusables.actions.actions-not-certified-by-github-note %}
2021

2122
## Introduction
2223

@@ -31,6 +32,8 @@ In the tutorial, you will first make a workflow file that uses the [`peter-evans
3132
3. Copy the following YAML contents into your workflow file.
3233

3334
```yaml{:copy}
35+
{% indented_data_reference reusables.actions.actions-not-certified-by-github-comment spaces=4 %}
36+
3437
name: Add comment
3538
on:
3639
issues:
@@ -44,7 +47,7 @@ In the tutorial, you will first make a workflow file that uses the [`peter-evans
4447
issues: write{% endif %}
4548
steps:
4649
- name: Add comment
47-
uses: peter-evans/create-or-update-comment@v1
50+
uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
4851
with:
4952
issue-number: {% raw %}${{ github.event.issue.number }}{% endraw %}
5053
body: |

0 commit comments

Comments
 (0)