Skip to content

Misc improvements #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
time: '04:00'
timezone: Europe/Copenhagen
open-pull-requests-limit: 20
21 changes: 21 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
on: pull_request
name: GitHub Actions

# Detect if this action is already running, and cancel it.
# This most likely happened because a second push has been made to a branch.
concurrency:
group: ${{ github.repository_id }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

jobs:
actionlint:
name: Actionlint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-actionlint@v1
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: "Testing on a branch that has an active environment"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: ./
id: active_url
Expand All @@ -22,7 +22,7 @@ jobs:
name: "Testing on a branch that does not exist"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: ./
id: missing_url
Expand All @@ -31,11 +31,11 @@ jobs:
PLATFORMSH_ID: ${{ secrets.TEST_PLATFORMSH_ID }}
PLATFORMSH_KEY: ${{ secrets.TEST_PLATFORMSH_KEY }}
ENVIRONMENT_NAME: nonexistent
DEPLOY_WAIT_TIME: 10
PSH_DETECTION_WAIT: 10

- name: Check for failure
if: ${{ steps.missing_url.outcome != 'failure' }}
uses: actions/github-script@v3
uses: actions/github-script@v7
with:
script: |
core.setFailed('The test did not fail as expected.')
Expand All @@ -44,7 +44,7 @@ jobs:
name: "Testing on a branch that used to exist"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: ./
id: inactive_url
Expand All @@ -53,11 +53,11 @@ jobs:
PLATFORMSH_ID: ${{ secrets.TEST_PLATFORMSH_ID }}
PLATFORMSH_KEY: ${{ secrets.TEST_PLATFORMSH_KEY }}
ENVIRONMENT_NAME: pr-462
DEPLOY_WAIT_TIME: 30
PSH_DETECTION_WAIT: 30

- name: Check for failure
if: ${{ steps.inactive_url.outcome != 'failure' }}
uses: actions/github-script@v3
uses: actions/github-script@v7
with:
script: |
core.setFailed('The test did not fail as expected.')
7 changes: 1 addition & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ outputs:
runs:
using: "composite"
steps:
- name: Setup PHP and disable opcache
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
extensions: none, curl, json, mbstring, pcre, phar
- name: Get PlatformSH URL
shell: bash
id: platformsh_url
Expand All @@ -65,7 +60,7 @@ runs:
export PLATFORM_BRANCH=${{ inputs.ENVIRONMENT_NAME }};
export PLATFORMSH_CLI_TOKEN=${{ inputs.PLATFORMSH_KEY }};

curl -fsS https://platform.sh/cli/installer | php
curl -fsSL https://raw.githubusercontent.com/platformsh/cli/main/installer.sh | bash

if [[ "${{ inputs.ALLOW_CANCEL_CRON }}" == 1 ]]; then \
~/.platformsh/bin/platform activity:cancel --type=environment.cron; \
Expand Down
Loading