From db759337331fe30e3d5a0ff1aa47d282f9b0c8e7 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Tue, 15 Jun 2021 10:51:25 -0500 Subject: [PATCH 1/3] Undeploy from staging manually using a script (#19875) * Add skeleton workflow and module for undeploying * Remove commented out code * Update undeployment module * Add '--destroy' flag to 'script/deploy' options * Add timeout and concurrency key for undeployment * Remove dangling unneeded function declaration * Add ant-man preview for inactive deployment state setting * Fix reference to pull request number * Refactor to extract more properties from the PR object * Fix reference to pull request number * Remove workflow * Add a README comment about '--destroy' usage * Fix grammar * Add missing 'ant-man' preview to createDeploymentStatus calls * Add missing preview to createDeploymentStatus calls * Find the latest existing deployment instead of creating a new one * Remove unused variable * Deactivate ALL deployments * Update copy * Add missing colons --- script/deploy | 44 ++++++--- script/deployment/deploy-to-staging.js | 18 ++-- script/deployment/undeploy-from-staging.js | 100 +++++++++++++++++++++ 3 files changed, 145 insertions(+), 17 deletions(-) create mode 100644 script/deployment/undeploy-from-staging.js diff --git a/script/deploy b/script/deploy index 76e542908d28..6dd9ddf7fbbd 100755 --- a/script/deploy +++ b/script/deploy @@ -15,10 +15,13 @@ // - Deploy a PR to Staging: // script/deploy --staging https://github.com/github/docs-internal/pull/12345 // -// - Deploy a PR to Staging and force the Heroku App to be rebuilt from scratch +// - Deploy a PR to Staging and force the Heroku App to be rebuilt from scratch: // script/deploy --staging https://github.com/github/docs/pull/9876 --rebuild // -// - Deploy the latest from docs-internal `main` to production +// - Undeploy a PR from Staging by deleting the Heroku App: +// script/deploy --staging https://github.com/github/docs/pull/9876 --destroy +// +// - Deploy the latest from docs-internal `main` to production: // script/deploy --production // // [end-readme] @@ -41,6 +44,7 @@ const { has } = require('lodash') const getOctokit = require('./helpers/github') const parsePrUrl = require('./deployment/parse-pr-url') const deployToStaging = require('./deployment/deploy-to-staging') +const undeployFromStaging = require('./deployment/undeploy-from-staging') const STAGING_FLAG = '--staging' const PRODUCTION_FLAG = '--production' @@ -53,6 +57,7 @@ program .option(PRODUCTION_FLAG, 'Deploy the latest internal main branch to Production') .option(`${STAGING_FLAG} `, 'Deploy a pull request to Staging') .option('--rebuild', 'Force a Staging deployment to rebuild the Heroku App from scratch') + .option('--destroy', 'Undeploy a Staging deployment by deleting the Heroku App') .parse(process.argv) const opts = program.opts() @@ -60,6 +65,7 @@ const isProduction = opts.production === true const isStaging = has(opts, 'staging') const prUrl = opts.staging const forceRebuild = opts.rebuild === true +const destroy = opts.destroy === true // // Verify CLI options @@ -85,6 +91,13 @@ if (isProduction && forceRebuild) { ) } +if (isProduction && destroy) { + return invalidateAndExit( + 'commander.conflictingArgument', + `error: cannot specify option '--destroy' combined with option '${PRODUCTION_FLAG}'` + ) +} + // Extract the repository name and pull request number from the URL (if any) const { owner, repo, pullNumber } = parsePrUrl(prUrl) @@ -113,7 +126,7 @@ async function deploy () { if (isProduction) { await deployProduction() } else if (isStaging) { - await deployStaging({ owner, repo, pullNumber, forceRebuild }) + await deployStaging({ owner, repo, pullNumber, forceRebuild, destroy }) } } @@ -126,7 +139,7 @@ async function deployProduction () { ) } -async function deployStaging ({ owner, repo, pullNumber, forceRebuild = false }) { +async function deployStaging ({ owner, repo, pullNumber, forceRebuild = false, destroy = false }) { // This helper uses the `GITHUB_TOKEN` implicitly const octokit = getOctokit() @@ -137,14 +150,23 @@ async function deployStaging ({ owner, repo, pullNumber, forceRebuild = false }) }) try { - await deployToStaging({ - herokuToken: HEROKU_API_TOKEN, - octokit, - pullRequest, - forceRebuild - }) + if (destroy) { + await undeployFromStaging({ + herokuToken: HEROKU_API_TOKEN, + octokit, + pullRequest + }) + } else { + await deployToStaging({ + herokuToken: HEROKU_API_TOKEN, + octokit, + pullRequest, + forceRebuild + }) + } } catch (error) { - console.error(`Failed to deploy to staging: ${error.message}`) + const action = destroy ? 'undeploy from' : 'deploy to' + console.error(`Failed to ${action} staging: ${error.message}`) console.error(error) process.exit(1) } diff --git a/script/deployment/deploy-to-staging.js b/script/deployment/deploy-to-staging.js index 0dc5187e76fd..3105dacfbc28 100644 --- a/script/deployment/deploy-to-staging.js +++ b/script/deployment/deploy-to-staging.js @@ -83,9 +83,11 @@ module.exports = async function deployToStaging ({ herokuToken, octokit, pullReq deployment_id: deploymentId, state: 'in_progress', description: 'Deploying the app...', - // The 'flash' preview is required for `state` values of 'in_progress' and 'queued' + // The 'ant-man' preview is required for `state` values of 'inactive', as well as + // the use of the `log_url`, `environment_url`, and `auto_inactive` parameters. + // The 'flash' preview is required for `state` values of 'in_progress' and 'queued'. mediaType: { - previews: ['flash'] + previews: ['ant-man', 'flash'] } }) console.log('🚀 Deployment status: in_progress - Preparing to deploy the app...') @@ -409,9 +411,11 @@ module.exports = async function deployToStaging ({ herokuToken, octokit, pullReq description: successMessage, ...logUrl && { log_url: logUrl }, environment_url: homepageUrl, - // The 'flash' preview is required for `state` values of 'in_progress' and 'queued' + // The 'ant-man' preview is required for `state` values of 'inactive', as well as + // the use of the `log_url`, `environment_url`, and `auto_inactive` parameters. + // The 'flash' preview is required for `state` values of 'in_progress' and 'queued'. mediaType: { - previews: ['flash'] + previews: ['ant-man', 'flash'] } }) @@ -432,9 +436,11 @@ module.exports = async function deployToStaging ({ herokuToken, octokit, pullReq description: failureMessage, ...logUrl && { log_url: logUrl }, environment_url: homepageUrl, - // The 'flash' preview is required for `state` values of 'in_progress' and 'queued' + // The 'ant-man' preview is required for `state` values of 'inactive', as well as + // the use of the `log_url`, `environment_url`, and `auto_inactive` parameters. + // The 'flash' preview is required for `state` values of 'in_progress' and 'queued'. mediaType: { - previews: ['flash'] + previews: ['ant-man', 'flash'] } }) diff --git a/script/deployment/undeploy-from-staging.js b/script/deployment/undeploy-from-staging.js new file mode 100644 index 000000000000..5bead29b90ec --- /dev/null +++ b/script/deployment/undeploy-from-staging.js @@ -0,0 +1,100 @@ +const Heroku = require('heroku-client') +const createStagingAppName = require('./create-staging-app-name') + +module.exports = async function undeployFromStaging ({ + herokuToken, + octokit, + pullRequest +}) { + // Start a timer so we can report how long the deployment takes + const startTime = Date.now() + + // Extract some important properties from the PR + const { + number: pullNumber, + base: { + repo: { + name: repo, + owner: { login: owner } + } + }, + head: { + ref: branch + } + } = pullRequest + + const appName = createStagingAppName({ repo, pullNumber, branch }) + + try { + const title = `from the 'staging' environment as '${appName}'` + + console.log(`About to undeploy ${title}...`) + + // Time to talk to Heroku... + const heroku = new Heroku({ token: herokuToken }) + + // Is there already a Heroku App for this PR? + let appExists = true + try { + await heroku.get(`/apps/${appName}`) + } catch (error) { + appExists = false + } + + // If there is an existing app, delete it + if (appExists) { + try { + await heroku.delete(`/apps/${appName}`) + + console.log(`Heroku app '${appName}' deleted`) + } catch (error) { + throw new Error(`Failed to delete Heroku app '${appName}'. Error: ${error}`) + } + } + + // Get the latest deployment environment to signal its deactivation + const { data: deployments } = await octokit.repos.listDeployments({ + owner, + repo, + + // In the GitHub API, there can only be one active deployment per environment. + // For our many staging apps, we must use the unique appName as the environment. + environment: appName + }) + + if (deployments.length === 0) { + console.log('🚀 No deployments to deactivate!') + console.log(`Finished undeploying after ${Math.round((Date.now() - startTime) / 1000)} seconds`) + return + } + + console.log(`Found ${deployments.length} GitHub Deployments`, deployments) + + // Deactivate ALL of the deployments + for (const deployment of deployments) { + const { data: deploymentStatus } = await octokit.repos.createDeploymentStatus({ + owner, + repo, + deployment_id: deployment.id, + state: 'inactive', + description: 'The app was undeployed', + // The 'ant-man' preview is required for `state` values of 'inactive', as well as + // the use of the `log_url`, `environment_url`, and `auto_inactive` parameters. + // The 'flash' preview is required for `state` values of 'in_progress' and 'queued'. + mediaType: { + previews: ['ant-man', 'flash'] + } + }) + console.log(`🚀 Deployment status (ID: ${deployment.id}): ${deploymentStatus.state} - ${deploymentStatus.description}`) + } + + console.log(`Finished undeploying after ${Math.round((Date.now() - startTime) / 1000)} seconds`) + } catch (error) { + // Report failure! + const failureMessage = `Undeployment failed after ${Math.round((Date.now() - startTime) / 1000)} seconds. See logs for more information.` + console.error(failureMessage) + + // Re-throw the error to bubble up + throw error + } +} From 9ecccfdf339b51062dd8f47e7f93389b5c2548d4 Mon Sep 17 00:00:00 2001 From: Matt Pollard Date: Tue, 15 Jun 2021 17:57:12 +0200 Subject: [PATCH 2/3] Bump `peter-evans/create-issue-from-file` to support `repository` input (#19922) --- .github/allowed-actions.js | 2 +- .github/workflows/check-all-english-links.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/allowed-actions.js b/.github/allowed-actions.js index 8824ee507f23..89322236ebb2 100644 --- a/.github/allowed-actions.js +++ b/.github/allowed-actions.js @@ -29,7 +29,7 @@ module.exports = [ "lee-dohm/close-matching-issues@22002609b2555fe18f52b8e2e7c07cbf5529e8a8", "lee-dohm/no-response@9bb0a4b5e6a45046f00353d5de7d90fb8bd773bb", "pascalgn/automerge-action@c9bd1823770819dc8fb8a5db2d11a3a95fbe9b07", // v0.12.0 - "peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326", + "peter-evans/create-issue-from-file@b4f9ee0a9d4abbfc6986601d9b1a4f8f8e74c77e", "peter-evans/create-or-update-comment@5221bf4aa615e5c6e95bb142f9673a9c791be2cd", "peter-evans/create-pull-request@8c603dbb04b917a9fc2dd991dc54fef54b640b43", "rachmari/actions-add-new-issue-to-column@1a459ef92308ba7c9c9dc2fcdd72f232495574a9", diff --git a/.github/workflows/check-all-english-links.yml b/.github/workflows/check-all-english-links.yml index e9b869e90b34..a5e2faebc5ef 100644 --- a/.github/workflows/check-all-english-links.yml +++ b/.github/workflows/check-all-english-links.yml @@ -36,7 +36,7 @@ jobs: - if: ${{ failure() }} name: Create issue from file id: broken-link-report - uses: peter-evans/create-issue-from-file@a04ce672e3acedb1f8e416b46716ddfd09905326 + uses: peter-evans/create-issue-from-file@b4f9ee0a9d4abbfc6986601d9b1a4f8f8e74c77e with: token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }} title: ${{ steps.check.outputs.title }} From f3de3ee6189f9a19f9db122687487b3ac8be7df0 Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Tue, 15 Jun 2021 11:09:15 -0500 Subject: [PATCH 3/3] Update actions/github-script usage to v4.0.2 (#19897) --- .github/allowed-actions.js | 2 +- .github/workflows/check-for-spammy-issues.yml | 2 +- .github/workflows/confirm-internal-staff-work-in-docs.yml | 2 +- .github/workflows/copy-api-issue-to-internal.yml | 2 +- .github/workflows/first-responder-docs-content.yml | 4 ++-- .github/workflows/merged-notification.yml | 2 +- .../workflows/move-existing-issues-to-the-correct-repo.yml | 2 +- .github/workflows/move-new-issues-to-correct-docs-repo.yml | 2 +- .github/workflows/move-reopened-issues-to-triage.yaml | 2 +- .github/workflows/repo-sync-stalls.yml | 2 +- .github/workflows/repo-sync.yml | 6 +++--- .github/workflows/start-new-engineering-pr-workflow.yml | 2 +- .github/workflows/transfer-api-issue-to-openapi.yml | 2 +- .github/workflows/translations.yml | 4 ++-- .github/workflows/triage-issue-comments.yml | 2 +- .github/workflows/triage-unallowed-contributions.yml | 6 +++--- 16 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/allowed-actions.js b/.github/allowed-actions.js index 89322236ebb2..8a4bc9746d91 100644 --- a/.github/allowed-actions.js +++ b/.github/allowed-actions.js @@ -6,7 +6,7 @@ module.exports = [ "actions/cache@0781355a23dac32fd3bac414512f4b903437991a", // v2.1.3 "actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f", // v2.3.4 - "actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9", // v3.0.0 + "actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d", // v4.0.2 "actions/labeler@5f867a63be70efff62b767459b009290364495eb", // v2.2.0 "actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e", // v2.1.4 "actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6", // v2.2.2 diff --git a/.github/workflows/check-for-spammy-issues.yml b/.github/workflows/check-for-spammy-issues.yml index 573eecb0ed1f..42f38895c35c 100644 --- a/.github/workflows/check-for-spammy-issues.yml +++ b/.github/workflows/check-for-spammy-issues.yml @@ -13,7 +13,7 @@ jobs: if: github.repository == 'github/docs' runs-on: ubuntu-latest steps: - - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + - uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }} script: | diff --git a/.github/workflows/confirm-internal-staff-work-in-docs.yml b/.github/workflows/confirm-internal-staff-work-in-docs.yml index 17ddc2908ee3..e07b5348fec7 100644 --- a/.github/workflows/confirm-internal-staff-work-in-docs.yml +++ b/.github/workflows/confirm-internal-staff-work-in-docs.yml @@ -20,7 +20,7 @@ jobs: if: github.repository == 'github/docs' && github.actor != 'docs-bot' steps: - id: membership_check - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d env: TEAM_CONTENT_REPO: ${{ secrets.TEAM_CONTENT_REPO }} with: diff --git a/.github/workflows/copy-api-issue-to-internal.yml b/.github/workflows/copy-api-issue-to-internal.yml index db8d822cb5ad..a41093bc98d2 100644 --- a/.github/workflows/copy-api-issue-to-internal.yml +++ b/.github/workflows/copy-api-issue-to-internal.yml @@ -16,7 +16,7 @@ jobs: if: github.event.label.name == 'rest-description' && github.repository == 'github/docs' steps: - name: Check if this run was triggered by a member of the docs team - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d id: triggered-by-member with: github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}} diff --git a/.github/workflows/first-responder-docs-content.yml b/.github/workflows/first-responder-docs-content.yml index c46b365eb753..69d92fa587b6 100644 --- a/.github/workflows/first-responder-docs-content.yml +++ b/.github/workflows/first-responder-docs-content.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Check if the event originated from a team member - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d id: set-result with: github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}} @@ -68,7 +68,7 @@ jobs: steps: - name: Remove card from project - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}} result-encoding: string diff --git a/.github/workflows/merged-notification.yml b/.github/workflows/merged-notification.yml index 9812c6d39143..eaf62731c8fa 100644 --- a/.github/workflows/merged-notification.yml +++ b/.github/workflows/merged-notification.yml @@ -14,7 +14,7 @@ jobs: if: github.repository == 'github/docs' && github.event.pull_request.merged && github.event.pull_request.base.ref == github.event.repository.default_branch runs-on: ubuntu-latest steps: - - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + - uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: script: | github.issues.createComment({ diff --git a/.github/workflows/move-existing-issues-to-the-correct-repo.yml b/.github/workflows/move-existing-issues-to-the-correct-repo.yml index 8194013d76aa..a15561d87e9f 100644 --- a/.github/workflows/move-existing-issues-to-the-correct-repo.yml +++ b/.github/workflows/move-existing-issues-to-the-correct-repo.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - id: move_to_correct_repo - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d env: TEAM_ENGINEERING_REPO: ${{ secrets.TEAM_ENGINEERING_REPO }} TEAM_CONTENT_REPO: ${{ secrets.TEAM_CONTENT_REPO }} diff --git a/.github/workflows/move-new-issues-to-correct-docs-repo.yml b/.github/workflows/move-new-issues-to-correct-docs-repo.yml index 77935392387b..f215fe25a112 100644 --- a/.github/workflows/move-new-issues-to-correct-docs-repo.yml +++ b/.github/workflows/move-new-issues-to-correct-docs-repo.yml @@ -18,7 +18,7 @@ jobs: if: github.repository == 'github/docs-internal' steps: - id: move_to_correct_repo - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d env: TEAM_ENGINEERING_REPO: ${{ secrets.TEAM_ENGINEERING_REPO }} TEAM_CONTENT_REPO: ${{ secrets.TEAM_CONTENT_REPO }} diff --git a/.github/workflows/move-reopened-issues-to-triage.yaml b/.github/workflows/move-reopened-issues-to-triage.yaml index 415c97d8c85a..617dc95182fd 100644 --- a/.github/workflows/move-reopened-issues-to-triage.yaml +++ b/.github/workflows/move-reopened-issues-to-triage.yaml @@ -14,7 +14,7 @@ jobs: if: github.repository == 'github/docs' runs-on: ubuntu-latest steps: - - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + - uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{ github.token }} script: | diff --git a/.github/workflows/repo-sync-stalls.yml b/.github/workflows/repo-sync-stalls.yml index 6a40377c5e82..5b0927bc788d 100644 --- a/.github/workflows/repo-sync-stalls.yml +++ b/.github/workflows/repo-sync-stalls.yml @@ -15,7 +15,7 @@ jobs: steps: - if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' name: Check if repo sync is stalled - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }} script: | diff --git a/.github/workflows/repo-sync.yml b/.github/workflows/repo-sync.yml index 5f1cfb12d9af..d3af62973f37 100644 --- a/.github/workflows/repo-sync.yml +++ b/.github/workflows/repo-sync.yml @@ -37,7 +37,7 @@ jobs: - name: Close pull request if unwanted if: ${{ github.repository == 'github/docs' && steps.find-pull-request.outputs.number }} - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{ secrets.DOCS_BOT_SPAM_VISION }} script: | @@ -139,7 +139,7 @@ jobs: # There are cases where the branch becomes out-of-date in between the time this workflow began and when the pull request is created/updated - name: Update branch if: ${{ steps.find-pull-request.outputs.number }} - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} script: | @@ -188,7 +188,7 @@ jobs: - name: Enable GitHub auto-merge if: ${{ steps.find-pull-request.outputs.number }} - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{ secrets.OCTOMERGER_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }} script: | diff --git a/.github/workflows/start-new-engineering-pr-workflow.yml b/.github/workflows/start-new-engineering-pr-workflow.yml index 1ea1d245143e..f77686af2022 100644 --- a/.github/workflows/start-new-engineering-pr-workflow.yml +++ b/.github/workflows/start-new-engineering-pr-workflow.yml @@ -19,7 +19,7 @@ jobs: DRAFT_COLUMN_ID: 10095775 REGULAR_COLUMN_ID: 10095779 steps: - - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + - uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d continue-on-error: true with: github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }} diff --git a/.github/workflows/transfer-api-issue-to-openapi.yml b/.github/workflows/transfer-api-issue-to-openapi.yml index fac0bf96bb30..0838502fc7f3 100644 --- a/.github/workflows/transfer-api-issue-to-openapi.yml +++ b/.github/workflows/transfer-api-issue-to-openapi.yml @@ -16,7 +16,7 @@ jobs: if: github.event.label.name == 'rest-schema' && github.repository == 'github/docs' steps: - name: Check if this run was triggered by a member of the docs team - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d id: triggered-by-member with: github-token: ${{secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES}} diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 9ed82ba41fd2..1b84ada807a0 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -31,7 +31,7 @@ jobs: state: open - if: ${{ steps.pr.outputs.number }} name: Check if already labeled - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d id: has-label with: script: | @@ -51,7 +51,7 @@ jobs: number: ${{ steps.pr.outputs.number }} - if: ${{ !steps.has-label.outputs.result }} name: Add automerge label - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/.github/workflows/triage-issue-comments.yml b/.github/workflows/triage-issue-comments.yml index e6bb3497609e..2879f7fba8ef 100644 --- a/.github/workflows/triage-issue-comments.yml +++ b/.github/workflows/triage-issue-comments.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Check if the event originated from a team member - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d id: is-internal-contributor with: github-token: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/triage-unallowed-contributions.yml b/.github/workflows/triage-unallowed-contributions.yml index 55b01808e922..8abc6e841a1f 100644 --- a/.github/workflows/triage-unallowed-contributions.yml +++ b/.github/workflows/triage-unallowed-contributions.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - name: Check for existing requested changes id: requested-change - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{secrets.GITHUB_TOKEN}} result-encoding: json @@ -82,7 +82,7 @@ jobs: - name: Request pull request changes # Check for no reviews or reviews that aren't CHANGES_REQUESTED if: ${{ steps.filter.outputs.notAllowed == 'true' && (!steps.requested-change.outputs.result || fromJson(steps.requested-change.outputs.result).state != 'CHANGES_REQUESTED') }} - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -118,7 +118,7 @@ jobs: # Check that unallowed files aren't modified and that a # CHANGES_REQUESTED review already exists if: ${{ steps.filter.outputs.notAllowed == 'false' && steps.requested-change.outputs.result && fromJson(steps.requested-change.outputs.result).state == 'CHANGES_REQUESTED' }} - uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d with: github-token: ${{secrets.GITHUB_TOKEN}} script: |