From afd3cef086a389db45d59ca67922f35119506fcc Mon Sep 17 00:00:00 2001 From: Rachael Sewell Date: Fri, 19 Feb 2021 11:59:15 -0800 Subject: [PATCH 1/3] update repo sync (#17919) --- .github/allowed-actions.js | 2 +- .github/workflows/repo-sync.yml | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/allowed-actions.js b/.github/allowed-actions.js index d156603d81cc..f0e792dda2e7 100644 --- a/.github/allowed-actions.js +++ b/.github/allowed-actions.js @@ -31,7 +31,7 @@ module.exports = [ 'rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9', 'rachmari/labeler@832d42ec5523f3c6d46e8168de71cd54363e3e2e', 'repo-sync/github-sync@3832fe8e2be32372e1b3970bbae8e7079edeec88', - 'repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d', + 'repo-sync/pull-request@65194d8015be7624d231796ddee1cd52a5023cb3', // repo-sync/pull-request@v2.6 'someimportantcompany/github-actions-slack-message@0b470c14b39da4260ed9e3f9a4f1298a74ccdefd', 'tjenkinson/gh-action-auto-merge-dependency-updates@4d7756c04d9d999c5968697a621b81c47f533d61', 'EndBug/add-and-commit@9358097a71ad9fb9e2f9624c6098c89193d83575', diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index 90664d9bb57d..bbdb151292a5 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -46,7 +46,7 @@ jobs: - name: Create pull request id: create-pull - uses: repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d + uses: repo-sync/pull-request@65194d8015be7624d231796ddee1cd52a5023cb3 env: GITHUB_TOKEN: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} with: @@ -66,8 +66,21 @@ jobs: base: main author: Octomerger + # Sometimes the `repo-sync` branch gets created but GitHub thinks a pull + # request is already attached to the branch. This may happen when an + # external contributor creates a pull request for the `repo-sync` branch + # in a fork, then deletes their repository. If there were changes added + # to the `repo-sync` branch but no pull request can be found, we should + # fail. The failure will then be sent to Slack in the last step. + - name: Check for pull request creation errors + if: ${{ !steps.find-pull-request.outputs.number && steps.create-pull.outputs.has_changed_files == 'true'}} + id: check-pr-creation + run: | + echo 'Unable to create a new PR for the existing branch `repo-sync`. Delete that branch and re-run this workflow to generate a new PR.' + exit 1 # prevents further steps from running + - name: Approve pull request - if: ${{ steps.find-pull-request.outputs.number }} + if: ${{ steps.find-pull-request.outputs.number}} uses: juliangruber/approve-pull-request-action@c530832d4d346c597332e20e03605aa94fa150a8 with: github-token: ${{ secrets.GITHUB_TOKEN }} From f9b50ac4387b46f8a3ca80ede226fb15384ff7f3 Mon Sep 17 00:00:00 2001 From: Beth Brennan <34719884+elbrenn@users.noreply.github.com> Date: Fri, 19 Feb 2021 15:20:42 -0500 Subject: [PATCH 2/3] use new workflow filename routes for badges (#17518) * use new workflow filename routes for badges * file name * use real repo name --- .../adding-a-workflow-status-badge.md | 35 ++++--------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md b/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md index 523e8d551cb9..92fa7fc3d7aa 100644 --- a/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md +++ b/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md @@ -12,38 +12,17 @@ versions: {% data reusables.repositories.actions-workflow-status-badge-into %} -If your workflow uses the `name` keyword, you must reference the workflow by name. If the name of your workflow contains white space, you'll need to replace the space with the URL encoded string `%20`. For more information about the `name` keyword, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/articles/workflow-syntax-for-github-actions#name)." +You reference the workflow by the name of your workflow file. ``` -https://github.com///workflows//badge.svg +https://github.com///actions/workflows//badge.svg ``` +### Using the workflow file name -Alternatively, if your workflow doesn't have a `name`, you must reference the workflow file using the file path relative to the repository's root directory. - -{% note %} - -**Note:** Referencing the workflow file using the file path does not work if the workflow has a `name`. - -{% endnote %} - -``` -https://github.com///workflows//badge.svg -``` - -### Using a workflow name - -This Markdown example adds a status badge for a workflow with the name "Greet Everyone." The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`. - -```markdown -![example workflow name](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg) -``` - -### Using a workflow file path - -This Markdown example adds a status badge for a workflow with the file path `.github/workflows/main.yml`. The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`. +This Markdown example adds a status badge for a workflow with the file path `.github/workflows/main.yml`. The `OWNER` of the repository is the `github` organization and the `REPOSITORY` name is `docs`. ```markdown -![example workflow file path](https://github.com/actions/hello-world/workflows/.github/workflows/main.yml/badge.svg) +![example workflow](https://github.com/github/docs/actions/workflows/main.yml/badge.svg) ``` ### Using the `branch` parameter @@ -51,7 +30,7 @@ This Markdown example adds a status badge for a workflow with the file path `.gi This Markdown example adds a status badge for a branch with the name `feature-1`. ```markdown -![example branch parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?branch=feature-1) +![example branch parameter](https://github.com/github/docs/actions/workflows/main.yml/badge.svg?branch=feature-1) ``` ### Using the `event` parameter @@ -59,5 +38,5 @@ This Markdown example adds a status badge for a branch with the name `feature-1` This Markdown example adds a badge that displays the status of workflow runs triggered by the `pull_request` event. ```markdown -![example event parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?event=pull_request) +![example event parameter](https://github.com/github/docs/actions/workflows/main.yml/badge.svg?event=pull_request) ``` From 00e981793b97339cbc62e6d858d5fe462478171d Mon Sep 17 00:00:00 2001 From: Octomerger Bot <63058869+Octomerger@users.noreply.github.com> Date: Sat, 20 Feb 2021 07:13:11 +1000 Subject: [PATCH 3/3] repo sync (#17931) --- .github/workflows/repo-freeze-check.yml | 3 ++- content/actions/reference/events-that-trigger-workflows.md | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/repo-freeze-check.yml b/.github/workflows/repo-freeze-check.yml index 7611d3ee544b..a1389ba31361 100644 --- a/.github/workflows/repo-freeze-check.yml +++ b/.github/workflows/repo-freeze-check.yml @@ -1,7 +1,8 @@ name: Repo Freeze Check on: - pull_request: + workflow_dispatch: + pull_request_target: types: - opened - reopened diff --git a/content/actions/reference/events-that-trigger-workflows.md b/content/actions/reference/events-that-trigger-workflows.md index e52cb74a8a6e..9693d877b46e 100644 --- a/content/actions/reference/events-that-trigger-workflows.md +++ b/content/actions/reference/events-that-trigger-workflows.md @@ -271,6 +271,12 @@ on: deployment_status ``` +{% note %} + +**Note:** When a deployment status's state is set to `inactive`, a webhook event will not be created. + +{% endnote %} + #### `fork` Runs your workflow anytime when someone forks a repository, which triggers the `fork` event. For information about the REST API, see "[Create a fork](/rest/reference/repos#create-a-fork)."