Skip to content

Update laminas/automatic-releases action to v1.25.0 #363

Update laminas/automatic-releases action to v1.25.0

Update laminas/automatic-releases action to v1.25.0 #363

name: 'Continuous Integration'
on:
pull_request:
push:
branches:
- '[0-9]+.[0-9]+.x'
- 'refs/pull/*'
tags:
jobs:
coding-standards:
name: "Coding Standards"
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- 8.2
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: "mbstring, json, mongo"
php-version: ${{ matrix.php-version }}
- name: "Validate composer.json and composer.lock"
run: composer validate --strict
- name: "Cache dependencies installed with composer"
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: "Install locked dependencies with composer"
run: composer install --no-interaction --no-progress --no-suggest
- name: "Run localheinz/composer-normalize"
run: composer normalize --dry-run
merge:
name: "Merge"
runs-on: "ubuntu-latest"
needs:
- "coding-standards"
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.draft == false &&
contains(github.event.pull_request.labels.*.name, 'automerge')
steps:
- name: "Request review from @nucleos-bot"
uses: "actions/github-script@v7"
with:
github-token: "${{ secrets.NUCLEOS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.pull_request
const repository = context.repo
const reviewers = [
"nucleos-bot",
]
await github.pulls.requestReviewers({
owner: repository.owner,
pull_number: pullRequest.number,
repo: repository.repo,
reviewers: reviewers,
})
- name: "Assign @nucleos-bot"
uses: "actions/github-script@v7"
with:
github-token: "${{ secrets.NUCLEOS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.pull_request
const repository = context.repo
const reviewers = [
"nucleos-bot",
]
await github.issues.addAssignees({
assignees: reviewers,
issue_number: pullRequest.number,
owner: repository.owner,
repo: repository.repo,
})
- name: "Approve pull request"
uses: "actions/github-script@v7"
if: "github.actor != 'nucleos-bot'"
with:
github-token: "${{ secrets.NUCLEOS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.pull_request
const repository = context.repo
await github.pulls.createReview({
event: "APPROVE",
owner: repository.owner,
pull_number: pullRequest.number,
repo: repository.repo,
})
- name: "Merge pull request"
uses: "actions/github-script@v7"
with:
github-token: "${{ secrets.NUCLEOS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.pull_request
const repository = context.repo
await github.pulls.merge({
merge_method: "merge",
owner: repository.owner,
pull_number: pullRequest.number,
repo: repository.repo,
})