Skip to content

Commit

Permalink
Merge pull request #575 from opendevshop/ci/github/actions-branches
Browse files Browse the repository at this point in the history
CI / Scheduled Builds / 1.x Builds failing because of bad `github deployment` call.
  • Loading branch information
jonpugh committed Apr 22, 2020
2 parents 548b69d + 7542332 commit 2842575
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Build

on:
push:
branches:
- 1.x
branches: 1.x
pull_request:
types: [opened, synchronize]
schedule:
Expand All @@ -18,7 +17,7 @@ env:
GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_RUN_LOG_URL: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true
GITHUB_RUN_LOG_URL: https://github.com/opendevshop/devshop/actions/runs/${{ github.run_id }}

jobs:
build:
Expand Down Expand Up @@ -78,12 +77,12 @@ jobs:
- name: Create a GitHub Deployment to PR environment
if: ${{ github.event_name == 'pull_request' }}
run: |
bin/github deployment:start --environment=github.${OS}.pr${GITHUB_PR_NUMBER} --ref=${GITHUB_PR_SHA} --description="Triggered from ./.github/workflows/build.yml"
bin/github deployment:start --environment=github.pr${GITHUB_PR_NUMBER}.${OS} --ref=${GITHUB_PR_SHA} --description="Triggered from ./.github/workflows/build.yml"
- name: Create a GitHub Deployment to branch environment
if: ${{ github.event_name != 'pull_request' }}
run: |
bin/github deployment:start --environment=github.${OS}.$(bin/branch-or-tag) --ref=${GITHUB_SHA} --description="Triggered from ./.github/workflows/build.yml"
bin/github deployment:start --environment=github.$(bin/branch-or-tag).${OS} --ref=${GITHUB_SHA} --description="Triggered from ./.github/workflows/build.yml"
- name: Docker & Docker Compose Version
run: |
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:

env:
GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_RUN_LOG_URL: https://github.com/opendevshop/devshop/actions/runs/${{ github.run_id }}

jobs:
yaml-tasks:
Expand Down Expand Up @@ -52,20 +55,16 @@ jobs:
composer require devshop/power-process
composer install --prefer-dist --no-progress --no-suggest
- name: Run Yaml Tests
- name: Run Yaml Tasks
working-directory: ${{env.working-directory}}
env:
GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_RUN_LOG_URL: https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}?check_suite_focus=true

# @TODO: Get environment variable setting to work.
# YAML_TASKS_STATUS_URL: https://github.com/${GITHUB_REPOSITORY}/runs/${GITHUB_RUN_ID}?check_suite_focus=true
PROVISION_PROCESS_OUTPUT: direct
run: |
chmod +x yaml-tasks
./yaml-tasks --ansi -v --hostname=github.com --status-url=${GITHUB_RUN_LOG_URL}
./yaml-tasks --tasks-file tests.yml --ansi -v --hostname=github.com --status-url=${GITHUB_RUN_LOG_URL}
./yaml-tasks --ansi -v --hostname=github.com --status-url=${GITHUB_RUN_LOG_URL}#step:7:1
./yaml-tasks --tasks-file tests.yml --ansi -v --hostname=github.com --status-url=${GITHUB_RUN_LOG_URL}#step:7:1
power-process:
name: PowerProcess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
);
$params->context = $task_name;

$params->description = substr($params->description, 0, self::GITHUB_STATUS_DESCRIPTION_MAX_SIZE - 3) . '...';
if (strlen($params->description) > self::GITHUB_STATUS_DESCRIPTION_MAX_SIZE) {
$params->description = substr($params->description, 0, self::GITHUB_STATUS_DESCRIPTION_MAX_SIZE - 1) . '';
}

// Post status to github
try {
Expand Down Expand Up @@ -563,7 +565,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

if (!$input->getOption('dry-run')) {
$params->description = substr($params->description, 0, self::GITHUB_STATUS_DESCRIPTION_MAX_SIZE - 3) . '...';
$params->description = substr($params->description, 0, self::GITHUB_STATUS_DESCRIPTION_MAX_SIZE);
$response = $client->getHttpClient()->post("/repos/$this->repoOwner/$this->repoName/statuses/$this->repoSha", json_encode($params));
$this->commitStatusMessage($response, $task_name, $task, $params->state);
}
Expand Down

0 comments on commit 2842575

Please sign in to comment.