Skip to content
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

Update GitHub Actions removing deprecated and adding dependabot #169

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
18 changes: 18 additions & 0 deletions .github/workflows/dependabot-merge-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Auto-merge Dependabot PRs
stovak marked this conversation as resolved.
Show resolved Hide resolved

on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
33 changes: 33 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
commit-message:
prefix: "ci"
include: "scope"
labels:
- "dependencies"
- "github_actions"
reviewers:
- "dependabot"

# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
commit-message:
prefix: "composer"
include: "scope"
labels:
- "dependencies"
- "php"
versioning-strategy: "increase-if-necessary"
allow:
- dependency-type: "direct"
- dependency-type: "indirect"
42 changes: 14 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ jobs:
name: "Run validation test suite"
runs-on: ubuntu-latest
env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
WP_CLI_BIN_DIR: /tmp/wp-cli-phar
DB_NAME: pantheon
DB_USER: pantheon
Expand Down Expand Up @@ -44,18 +43,18 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer Downloads
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-

- name: Cache PHP dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
Expand All @@ -66,7 +65,6 @@ jobs:

- name: Install WP-CLI
run: |
# The Behat test suite will pick up the executable found in $WP_CLI_BIN_DIR
mkdir -p $WP_CLI_BIN_DIR
curl -s https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > $WP_CLI_BIN_DIR/wp
chmod +x $WP_CLI_BIN_DIR/wp
Expand All @@ -80,22 +78,25 @@ jobs:
vendor/bin/behat --ansi

- name: Archive phar
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: wp-launch-check-phar
path: wp_launch_check.phar
retention-days: 5
if-no-files-found: error

deploy-packages:
name: Deploy
runs-on: ubuntu-latest
needs: [validate]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download Phar
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: wp-launch-check-phar

Expand All @@ -105,26 +106,11 @@ jobs:
with:
myToken: ${{ secrets.ACCESS_TOKEN }}

- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
stovak marked this conversation as resolved.
Show resolved Hide resolved
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
${{ steps.changelog.outputs.changelog }}
token: ${{ secrets.ACCESS_TOKEN }}
body: ${{ steps.changelog.outputs.changelog }}
files: wp_launch_check.phar
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wp_launch_check.phar
asset_name: wp_launch_check.phar
asset_content_type: application/zip
prerelease: false
Loading