1
0
mirror of synced 2026-01-08 21:02:10 -05:00

Merge pull request #9966 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2021-09-10 16:09:24 -04:00
committed by GitHub
2 changed files with 102 additions and 6 deletions

View File

@@ -26,9 +26,7 @@ env:
PR_URL: ${{ github.event.workflow_run.repository.html_url }}/pull/${{ github.event.workflow_run.pull_requests[0].number }}
jobs:
prepare:
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_TOKEN }}
check-pr-before-prepare:
if: >-
${{
github.event.workflow_run.conclusion == 'success' &&
@@ -36,6 +34,32 @@ jobs:
startsWith(github.event.workflow_run.head_branch, 'docker-')
}}
runs-on: ubuntu-latest
timeout-minutes: 1
concurrency:
group: staging_docker_${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
outputs:
pull_request_state: ${{ steps.check-pr.outputs.state }}
steps:
- name: Check pull request state
id: check-pr
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
with:
script: |
const { owner, repo } = context.repo
const { data: pullRequest } = await octokit.pulls.get({
owner,
repo,
pull_number: pullNumber
})
core.setOutput('state', pullRequest.state)
prepare:
needs: check-pr-before-prepare
if: ${{ needs.check-pr-before-prepare.outputs.pull_request_state == 'open' }}
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_TOKEN }}
runs-on: ubuntu-latest
timeout-minutes: 20
concurrency:
group: staging_docker_${{ github.event.workflow_run.head_branch }}
@@ -167,9 +191,33 @@ jobs:
color: failure
text: Staging preparation (docker) failed for PR ${{ env.PR_URL }} at commit ${{ github.sha }}. See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
deploy:
check-pr-before-deploy:
needs: prepare
runs-on: ubuntu-latest
timeout-minutes: 1
concurrency:
group: staging_docker_${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
outputs:
pull_request_state: ${{ steps.check-pr.outputs.state }}
steps:
- name: Check pull request state
id: check-pr
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
with:
script: |
const { owner, repo } = context.repo
const { data: pullRequest } = await octokit.pulls.get({
owner,
repo,
pull_number: ${{ github.event.workflow_run.pull_requests[0].number }}
})
core.setOutput('state', pullRequest.state)
deploy:
needs: [prepare, check-pr-before-deploy]
if: ${{ needs.check-pr-before-deploy.outputs.pull_request_state == 'open' }}
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: staging_docker_${{ github.event.workflow_run.head_branch }}

View File

@@ -30,13 +30,37 @@ env:
ACTIONS_RUN_LOG: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
jobs:
prepare:
check-pr-before-prepare:
if: >-
${{
github.event.workflow_run.conclusion == 'success' &&
(github.repository == 'github/docs-internal' || github.repository == 'github/docs')
}}
runs-on: ubuntu-latest
timeout-minutes: 1
concurrency:
group: staging_${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
outputs:
pull_request_state: ${{ steps.check-pr.outputs.state }}
steps:
- name: Check pull request state
id: check-pr
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
with:
script: |
const { owner, repo } = context.repo
const { data: pullRequest } = await octokit.pulls.get({
owner,
repo,
pull_number: ${{ github.event.workflow_run.pull_requests[0].number }}
})
core.setOutput('state', pullRequest.state)
prepare:
needs: check-pr-before-prepare
if: ${{ needs.check-pr-before-prepare.outputs.pull_request_state == 'open' }}
runs-on: ubuntu-latest
timeout-minutes: 5
concurrency:
group: staging_${{ github.event.workflow_run.head_branch }}
@@ -181,9 +205,33 @@ jobs:
color: failure
text: Staging preparation failed for PR ${{ env.PR_URL }} at commit ${{ github.event.workflow_run.head_sha }}. See ${{ env.ACTIONS_RUN_LOG }}
deploy:
check-pr-before-deploy:
needs: prepare
runs-on: ubuntu-latest
timeout-minutes: 1
concurrency:
group: staging_${{ github.event.workflow_run.head_branch }}
cancel-in-progress: true
outputs:
pull_request_state: ${{ steps.check-pr.outputs.state }}
steps:
- name: Check pull request state
id: check-pr
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
with:
script: |
const { owner, repo } = context.repo
const { data: pullRequest } = await octokit.pulls.get({
owner,
repo,
pull_number: ${{ github.event.workflow_run.pull_requests[0].number }}
})
core.setOutput('state', pullRequest.state)
deploy:
needs: [prepare, check-pr-before-deploy]
if: ${{ needs.check-pr-before-deploy.outputs.pull_request_state == 'open' }}
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: staging_${{ github.event.workflow_run.head_branch }}