Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f89abbd
Merge branch 'main' into repo-sync
Octomerger Apr 20, 2021
8dc7968
Merge pull request #18874 from github/repo-sync
Octomerger Apr 20, 2021
c38bbfd
Add versioning for `[skip ci]`, previously omitted (#18875)
hubwriter Apr 20, 2021
fec61ef
Merge branch 'main' into repo-sync
Octomerger Apr 20, 2021
262fe57
Merge pull request #18876 from github/repo-sync
Octomerger Apr 20, 2021
317872f
Remove outdated mention of sharing SMTP credentials with GitHub for G…
mattpollard Apr 20, 2021
de28b75
Configure `GITHUB_TOKEN` permissions (#18348)
hubwriter Apr 20, 2021
0b0127f
Merge pull request #5551 from github/repo-sync
Octomerger Apr 20, 2021
80e2732
Merge branch 'main' into repo-sync
Octomerger Apr 20, 2021
262878f
Merge branch 'main' into repo-sync
Octomerger Apr 20, 2021
3b31118
Merge pull request #18886 from github/repo-sync
Octomerger Apr 20, 2021
a2e216c
Merge pull request #5567 from github/repo-sync
Octomerger Apr 20, 2021
0c38306
Action ran graphql script"update-files"
rachmari Apr 20, 2021
79ecb96
End "custom core" primer, use regular core instead (#18887)
heiskr Apr 20, 2021
86ab625
Branch was updated using the 'autoupdate branch' Actions workflow.
Octomerger Apr 20, 2021
11db06d
GraphQL schema update
Octomerger Apr 20, 2021
9cf0ffc
Merge branch 'main' into repo-sync
Octomerger Apr 20, 2021
53f3551
Merge branch 'main' into repo-sync
Octomerger Apr 20, 2021
0ab7071
Merge pull request #18890 from github/repo-sync
Octomerger Apr 20, 2021
9c80b35
Merge pull request #5568 from github/repo-sync
Octomerger Apr 20, 2021
d61ae5b
Private image registry support & Codespaces audit logs (#18840)
timeyoutakeit Apr 20, 2021
73e55c6
Merge branch 'main' into repo-sync
Octomerger Apr 20, 2021
b9051d9
Merge pull request #18892 from github/repo-sync
Octomerger Apr 20, 2021
ead972a
Merge pull request #5571 from github/repo-sync
Octomerger Apr 20, 2021
ce508db
Remove thead background (#18883)
heiskr Apr 20, 2021
fea5399
Merge pull request #5576 from github/repo-sync
Octomerger Apr 20, 2021
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions content/actions/guides/adding-labels-to-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ In the tutorial, you will first make a workflow file that uses the [`andymckay/l
2. {% data reusables.actions.make-workflow-file %}
3. Copy the following YAML contents into your workflow file.

{% raw %}
```yaml{:copy}
name: Label issues
on:
Expand All @@ -39,14 +38,16 @@ In the tutorial, you will first make a workflow file that uses the [`andymckay/l
- opened
jobs:
label_issues:
runs-on: ubuntu-latest
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
issues: write{% endif %}
steps:
- name: Label issues
uses: andymckay/[email protected]
with:
add-labels: "triage"
```
{% endraw %}

4. Customize the parameters in your workflow file:
- 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)."
5. {% data reusables.actions.commit-workflow %}
Expand Down
9 changes: 5 additions & 4 deletions content/actions/guides/building-and-testing-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ jobs:

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`.

{% raw %}
```yaml
name: Upload dotnet package

Expand All @@ -237,19 +236,21 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
packages: write
contents: read{% endif %}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x' # SDK Version to use.
source-url: https://nuget.pkg.github.com/<owner>/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NUGET_AUTH_TOKEN: {% raw %}${{secrets.GITHUB_TOKEN}}{% endraw %}
- run: dotnet build --configuration Release <my project>
- name: Create the package
run: dotnet pack --configuration Release <my project>
- name: Publish the package to GPR
run: dotnet nuget push <my project>/bin/Release/*.nupkg
```
{% endraw %}
11 changes: 6 additions & 5 deletions content/actions/guides/building-and-testing-ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ You can configure your workflow to publish your Ruby package to any package regi

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`.

{% raw %}
```yaml

name: Ruby Gem
Expand All @@ -281,9 +280,12 @@ on:
jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
packages: write
contents: read{% endif %}

steps:
steps:{% raw %}
- uses: actions/checkout@v2
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -312,6 +314,5 @@ jobs:
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"{% endraw %}
```
{% endraw %}
10 changes: 6 additions & 4 deletions content/actions/guides/closing-inactive-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ In the tutorial, you will first make a workflow file that uses the [`actions/sta
2. {% data reusables.actions.make-workflow-file %}
3. Copy the following YAML contents into your workflow file.

{% raw %}
```yaml{:copy}
name: Close inactive issues
on:
Expand All @@ -38,7 +37,10 @@ In the tutorial, you will first make a workflow file that uses the [`actions/sta

jobs:
close-issues:
runs-on: ubuntu-latest
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
issues: write
pull-requests: write{% endif %}
steps:
- uses: actions/stale@v3
with:
Expand All @@ -49,9 +51,9 @@ In the tutorial, you will first make a workflow file that uses the [`actions/sta
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
```
{% endraw %}

4. Customize the parameters in your workflow file:
- 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)."
- 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`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ In the tutorial, you will first make a workflow file that uses the [`peter-evans
2. {% data reusables.actions.make-workflow-file %}
3. Copy the following YAML contents into your workflow file.

{% raw %}
```yaml{:copy}
name: Add comment
on:
Expand All @@ -39,16 +38,18 @@ In the tutorial, you will first make a workflow file that uses the [`peter-evans
jobs:
add-comment:
if: github.event.label.name == 'help-wanted'
runs-on: ubuntu-latest
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
issues: write{% endif %}
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
issue-number: {% raw %}${{ github.event.issue.number }}{% endraw %}
body: |
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:
```
{% endraw %}

4. Customize the parameters in your workflow file:
- 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.
- 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)."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ The following example workflow demonstrates how to build a container image and p

Ensure that you provide your own values for all the variables in the `env` key of the workflow.

{% raw %}
```yaml{:copy}
name: Deploy to Amazon ECS

Expand All @@ -98,9 +97,12 @@ defaults:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
packages: write
contents: read{% endif %}

steps:
{% raw %}steps:
- name: Checkout
uses: actions/checkout@v2

Expand Down Expand Up @@ -142,9 +144,9 @@ jobs:
task-definition: ${{ steps.task-def.outputs.task-definition }}
service: ${{ env.ECS_SERVICE }}
cluster: ${{ env.ECS_CLUSTER }}
wait-for-service-stability: true
wait-for-service-stability: true{% endraw %}
```
{% endraw %}


### Additional resources

Expand Down
26 changes: 14 additions & 12 deletions content/actions/guides/publishing-docker-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ The `build-push-action` options required for {% data variables.product.prodname_
* `registry`: Must be set to `docker.pkg.github.com`.
* `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`.

{% raw %}
```yaml{:copy}
name: Publish Docker image
on:
Expand All @@ -107,21 +106,23 @@ on:
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
packages: write
contents: read{% endif %}
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: {% raw %}${{ github.actor }}{% endraw %}
password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
registry: docker.pkg.github.com
repository: my-org/my-repo/my-image
tag_with_ref: true

```
{% endraw %}

{% data reusables.github-actions.docker-tag-with-ref %}

Expand All @@ -131,7 +132,6 @@ In a single workflow, you can publish your Docker image to multiple registries b

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.

{% raw %}
```yaml{:copy}
name: Publish Docker image
on:
Expand All @@ -140,26 +140,28 @@ on:
jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
runs-on: ubuntu-latest{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
packages: write
contents: read{% endif %}
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
username: {% raw %}${{ secrets.DOCKER_USERNAME }}{% endraw %}
password: {% raw %}${{ secrets.DOCKER_PASSWORD }}{% endraw %}
repository: my-docker-hub-namespace/my-docker-hub-repository
tag_with_ref: true
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: {% raw %}${{ github.actor }}{% endraw %}
password: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
registry: docker.pkg.github.com
repository: my-org/my-repo/my-image
tag_with_ref: true
```
{% endraw %}

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.
26 changes: 14 additions & 12 deletions content/actions/guides/publishing-java-packages-with-gradle.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Each time you create a new release, you can trigger a workflow to publish your p

You can define a new Maven repository in the publishing block of your _build.gradle_ that points to {% data variables.product.prodname_registry %}. In that repository configuration, you can also take advantage of environment variables set in your CI workflow run. You can use the `GITHUB_ACTOR` environment variable as a username, and you can set the `GITHUB_TOKEN` environment variable with your `GITHUB_TOKEN` secret.

The `GITHUB_TOKEN` exists in your repository by default and has read and write permissions for packages in the repository where the workflow runs. For more information, see "[Authenticating with the GITHUB_TOKEN](/actions/configuring-and-managing-workflows/authenticating-with-the-github_token)."
{% data reusables.github-actions.github-token-permissions %}

For example, if your organization is named "octocat" and your repository is named "hello-world", then the {% data variables.product.prodname_registry %} configuration in _build.gradle_ would look similar to the below example.

Expand All @@ -133,15 +133,17 @@ publishing {

With this configuration, you can create a workflow that publishes your package to the Maven Central Repository by running the `gradle publish` command.

{% raw %}
```yaml{:copy}
name: Publish package to GitHub Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
runs-on: ubuntu-latest {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
contents: read
packages: write {% endif %}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
Expand All @@ -151,12 +153,11 @@ jobs:
- name: Publish package
run: gradle publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
```
{% endraw %}

{% data reusables.github-actions.gradle-workflow-steps %}
1. Runs the `gradle publish` command to publish to {% data variables.product.prodname_registry %}. The `GITHUB_TOKEN` environment variable will be set with the content of the `GITHUB_TOKEN` secret.
1. Runs the `gradle publish` command to publish to {% data variables.product.prodname_registry %}. The `GITHUB_TOKEN` environment variable will be set with the content of the `GITHUB_TOKEN` secret. {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}The `permissions` key specifies the access that the `GITHUB_TOKEN` secret will allow.{% endif %}

For more information about using secrets in your workflow, see "[Creating and using encrypted secrets](/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."

Expand Down Expand Up @@ -199,15 +200,17 @@ publishing {

With this configuration, you can create a workflow that publishes your package to both the Maven Central Repository and {% data variables.product.prodname_registry %} by running the `gradle publish` command.

{% raw %}
```yaml{:copy}
name: Publish package to the Maven Central Repository and GitHub Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
runs-on: ubuntu-latest {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}
permissions:
contents: read
packages: write {% endif %}
steps:
- uses: actions/checkout@v2
- name: Set up Java
Expand All @@ -217,14 +220,13 @@ jobs:
distribution: 'adopt'
- name: Publish to the Maven Central Repository
run: gradle publish
env:
env: {% raw %}
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}{% endraw %}
```
{% endraw %}

{% data reusables.github-actions.gradle-workflow-steps %}
1. Runs the `gradle publish` command to publish to the `OSSRH` Maven repository and {% data variables.product.prodname_registry %}. The `MAVEN_USERNAME` environment variable will be set with the contents of your `OSSRH_USERNAME` secret, and the `MAVEN_PASSWORD` environment variable will be set with the contents of your `OSSRH_TOKEN` secret. The `GITHUB_TOKEN` environment variable will be set with the content of the `GITHUB_TOKEN` secret.
1. Runs the `gradle publish` command to publish to the `OSSRH` Maven repository and {% data variables.product.prodname_registry %}. The `MAVEN_USERNAME` environment variable will be set with the contents of your `OSSRH_USERNAME` secret, and the `MAVEN_PASSWORD` environment variable will be set with the contents of your `OSSRH_TOKEN` secret. The `GITHUB_TOKEN` environment variable will be set with the content of the `GITHUB_TOKEN` secret. {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "[email protected]" or currentVersion == "github-ae@next" %}The `permissions` key specifies the access that the `GITHUB_TOKEN` secret will allow.{% endif %}

For more information about using secrets in your workflow, see "[Creating and using encrypted secrets](/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
Loading