You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/actions/guides/adding-labels-to-issues.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,6 @@ In the tutorial, you will first make a workflow file that uses the [`andymckay/l
29
29
2. {% data reusables.actions.make-workflow-file %}
30
30
3. Copy the following YAML contents into your workflow file.
31
31
32
-
{% raw %}
33
32
```yaml{:copy}
34
33
name: Label issues
35
34
on:
@@ -39,14 +38,16 @@ In the tutorial, you will first make a workflow file that uses the [`andymckay/l
39
38
- opened
40
39
jobs:
41
40
label_issues:
42
-
runs-on: ubuntu-latest
41
+
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}
42
+
permissions:
43
+
issues: write{% endif %}
43
44
steps:
44
45
- name: Label issues
45
46
uses: andymckay/labeler@1.0.2
46
47
with:
47
48
add-labels: "triage"
48
49
```
49
-
{% endraw %}
50
+
50
51
4. Customize the parameters in your workflow file:
51
52
- Change the value for `add-labels` to the list of labels that you want to add to the issue. Separate multiple labels with commas. For example, `"help wanted, good first issue"`. For more information about labels, see "[Managing labels](/github/managing-your-work-on-github/managing-labels#applying-labels-to-issues-and-pull-requests)."
Copy file name to clipboardExpand all lines: content/actions/guides/building-and-testing-net.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,7 +227,6 @@ jobs:
227
227
228
228
You can configure your workflow to publish your Dotnet package to a package registry when your CI tests pass. You can use repository secrets to store any tokens or credentials needed to publish your binary. The following example creates and publishes a package to {% data variables.product.prodname_registry %} using `dotnet core cli`.
229
229
230
-
{% raw %}
231
230
```yaml
232
231
name: Upload dotnet package
233
232
@@ -237,19 +236,21 @@ on:
237
236
238
237
jobs:
239
238
deploy:
240
-
runs-on: ubuntu-latest
239
+
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}
Copy file name to clipboardExpand all lines: content/actions/guides/building-and-testing-ruby.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -264,7 +264,6 @@ You can configure your workflow to publish your Ruby package to any package regi
264
264
265
265
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`.
266
266
267
-
{% raw %}
268
267
```yaml
269
268
270
269
name: Ruby Gem
@@ -281,9 +280,12 @@ on:
281
280
jobs:
282
281
build:
283
282
name: Build + Publish
284
-
runs-on: ubuntu-latest
283
+
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}
Copy file name to clipboardExpand all lines: content/actions/guides/closing-inactive-issues.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,6 @@ In the tutorial, you will first make a workflow file that uses the [`actions/sta
29
29
2. {% data reusables.actions.make-workflow-file %}
30
30
3. Copy the following YAML contents into your workflow file.
31
31
32
-
{% raw %}
33
32
```yaml{:copy}
34
33
name: Close inactive issues
35
34
on:
@@ -38,7 +37,10 @@ In the tutorial, you will first make a workflow file that uses the [`actions/sta
38
37
39
38
jobs:
40
39
close-issues:
41
-
runs-on: ubuntu-latest
40
+
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}
41
+
permissions:
42
+
issues: write
43
+
pull-requests: write{% endif %}
42
44
steps:
43
45
- uses: actions/stale@v3
44
46
with:
@@ -49,9 +51,9 @@ In the tutorial, you will first make a workflow file that uses the [`actions/sta
49
51
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
50
52
days-before-pr-stale: -1
51
53
days-before-pr-close: -1
52
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
54
+
repo-token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
53
55
```
54
-
{% endraw %}
56
+
55
57
4. Customize the parameters in your workflow file:
56
58
- Change the value for `on.schedule` to dictate when you want this workflow to run. In the example above, the workflow will run every day at 1:30 UTC. For more information about scheduled workflows, see "[Scheduled events](/actions/reference/events-that-trigger-workflows#scheduled-events)."
57
59
- Change the value for `days-before-issue-stale` to the number of days without activity before the `actions/stale` action labels an issue. If you never want this action to label issues, set this value to `-1`.
Copy file name to clipboardExpand all lines: content/actions/guides/commenting-on-an-issue-when-a-label-is-added.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,6 @@ In the tutorial, you will first make a workflow file that uses the [`peter-evans
29
29
2. {% data reusables.actions.make-workflow-file %}
30
30
3. Copy the following YAML contents into your workflow file.
31
31
32
-
{% raw %}
33
32
```yaml{:copy}
34
33
name: Add comment
35
34
on:
@@ -39,16 +38,18 @@ In the tutorial, you will first make a workflow file that uses the [`peter-evans
39
38
jobs:
40
39
add-comment:
41
40
if: github.event.label.name == 'help-wanted'
42
-
runs-on: ubuntu-latest
41
+
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}
42
+
permissions:
43
+
issues: write{% endif %}
43
44
steps:
44
45
- name: Add comment
45
46
uses: peter-evans/create-or-update-comment@v1
46
47
with:
47
-
issue-number: ${{ github.event.issue.number }}
48
+
issue-number: {% raw %}${{ github.event.issue.number }}{% endraw %}
48
49
body: |
49
50
This issue is available for anyone to work on. **Make sure to reference this issue in your pull request.** :sparkles: Thank you for your contribution! :sparkles:
50
51
```
51
-
{% endraw %}
52
+
52
53
4. Customize the parameters in your workflow file:
53
54
- Replace `help-wanted` in `if: github.event.label.name == 'help-wanted'` with the label that you want to act on. If you want to act on more than one label, separate the conditions with `||`. For example, `if: github.event.label.name == 'bug' || github.event.label.name == 'fix me'` will comment whenever the `bug` or `fix me` labels are added to an issue.
54
55
- Change the value for `body` to the comment that you want to add. GitHub flavored markdown is supported. For more information about markdown, see "[Basic writing and formatting syntax](/github/writing-on-github/basic-writing-and-formatting-syntax)."
Copy file name to clipboardExpand all lines: content/actions/guides/deploying-to-amazon-elastic-container-service.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,6 @@ The following example workflow demonstrates how to build a container image and p
73
73
74
74
Ensure that you provide your own values for all the variables in the `env` key of the workflow.
75
75
76
-
{% raw %}
77
76
```yaml{:copy}
78
77
name: Deploy to Amazon ECS
79
78
@@ -98,9 +97,12 @@ defaults:
98
97
jobs:
99
98
deploy:
100
99
name: Deploy
101
-
runs-on: ubuntu-latest
100
+
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}
Copy file name to clipboardExpand all lines: content/actions/guides/publishing-docker-images.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,6 @@ The `build-push-action` options required for {% data variables.product.prodname_
98
98
*`registry`: Must be set to `docker.pkg.github.com`.
99
99
*`repository`: Must be set in the format `OWNER/REPOSITORY/IMAGE_NAME`. For example, for an image named `octo-image` stored on {% data variables.product.prodname_dotcom %} at `http://github.com/octo-org/octo-repo`, the `repository` option should be set to `octo-org/octo-repo/octo-image`.
100
100
101
-
{% raw %}
102
101
```yaml{:copy}
103
102
name: Publish Docker image
104
103
on:
@@ -107,21 +106,23 @@ on:
107
106
jobs:
108
107
push_to_registry:
109
108
name: Push Docker image to GitHub Packages
110
-
runs-on: ubuntu-latest
109
+
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}
110
+
permissions:
111
+
packages: write
112
+
contents: read{% endif %}
111
113
steps:
112
114
- name: Check out the repo
113
115
uses: actions/checkout@v2
114
116
- name: Push to GitHub Packages
115
117
uses: docker/build-push-action@v1
116
118
with:
117
-
username: ${{ github.actor }}
118
-
password: ${{ secrets.GITHUB_TOKEN }}
119
+
username: {% raw %}${{ github.actor }}{% endraw %}
120
+
password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
119
121
registry: docker.pkg.github.com
120
122
repository: my-org/my-repo/my-image
121
123
tag_with_ref: true
122
124
123
125
```
124
-
{% endraw %}
125
126
126
127
{% data reusables.github-actions.docker-tag-with-ref %}
127
128
@@ -131,7 +132,6 @@ In a single workflow, you can publish your Docker image to multiple registries b
131
132
132
133
The following example workflow uses the `build-push-action` steps from the previous sections ("[Publishing images to Docker Hub](#publishing-images-to-docker-hub)" and "[Publishing images to {% data variables.product.prodname_registry %}](#publishing-images-to-github-packages)") to create a single workflow that pushes to both registries.
133
134
134
-
{% raw %}
135
135
```yaml{:copy}
136
136
name: Publish Docker image
137
137
on:
@@ -140,26 +140,28 @@ on:
140
140
jobs:
141
141
push_to_registries:
142
142
name: Push Docker image to multiple registries
143
-
runs-on: ubuntu-latest
143
+
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@3.1" or currentVersion == "github-ae@next" %}
144
+
permissions:
145
+
packages: write
146
+
contents: read{% endif %}
144
147
steps:
145
148
- name: Check out the repo
146
149
uses: actions/checkout@v2
147
150
- name: Push to Docker Hub
148
151
uses: docker/build-push-action@v1
149
152
with:
150
-
username: ${{ secrets.DOCKER_USERNAME }}
151
-
password: ${{ secrets.DOCKER_PASSWORD }}
153
+
username: {% raw %}${{ secrets.DOCKER_USERNAME }}{% endraw %}
154
+
password: {% raw %}${{ secrets.DOCKER_PASSWORD }}{% endraw %}
username: {% raw %}${{ github.actor }}{% endraw %}
161
+
password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
159
162
registry: docker.pkg.github.com
160
163
repository: my-org/my-repo/my-image
161
164
tag_with_ref: true
162
165
```
163
-
{% endraw %}
164
166
165
167
The above workflow checks out the {% data variables.product.prodname_dotcom %} repository, and uses the `build-push-action` action twice to build and push the Docker image to Docker Hub and {% data variables.product.prodname_registry %}. For both steps, it sets the `build-push-action` option [`tag_with_ref`](https://github.com/marketplace/actions/build-and-push-docker-images#tag_with_ref) to automatically tag the built Docker image with the Git reference of the workflow event. This workflow is triggered on publishing a {% data variables.product.prodname_dotcom %} release, so the reference for both registries will be the Git tag for the release.
0 commit comments