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

UHF-9718: Added a tool to scan out-of-date HELfi packages #419

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all 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
42 changes: 34 additions & 8 deletions .github/workflows/update-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
repository_dispatch:
types: [config_change]
name: Update config
env:
GH_TOKEN: ${{ github.token }}
jobs:
update-config:
runs-on: ubuntu-latest
Expand All @@ -21,10 +23,7 @@ jobs:
- 3306:3306

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- uses: actions/checkout@v4
- name: Download latest dump
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -41,16 +40,43 @@ jobs:
# Update platform
drush helfi:tools:update-platform

- name: Check module versions
id: module-status
run: |
MODE="delete"
drush helfi:tools:check-composer-versions $GITHUB_WORKSPACE/composer.lock --format=markdown_table >> $GITHUB_STEP_SUMMARY && EXIT_CODE=$? || EXIT_CODE=$?
if [ "$EXIT_CODE" -eq 3 ]; then
MODE="upsert"
echo " " >> $GITHUB_STEP_SUMMARY
echo ":warning: Failed to install the latest version of the packages listed above" >> $GITHUB_STEP_SUMMARY
echo " " >> $GITHUB_STEP_SUMMARY
echo "Please run \`composer why-not drupal/package_name package_version\` to see why." >> $GITHUB_STEP_SUMMARY
fi
echo "MODE=$MODE" >> $GITHUB_OUTPUT
cat $GITHUB_STEP_SUMMARY > /tmp/pr-message.txt

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
committer: GitHub <[email protected]>
author: actions-bot <[email protected]>
commit-message: Update configuration
title: Automatic update
labels: auto-update
body: |
- Updated active configuration.
- Updated platform

branch: update-configuration

- name: Attempt to find PR
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
id: find-pr
run: echo "number=$(gh pr list --base ${BRANCH_NAME} --head update-configuration --json number --jq '.[].number')" >> $GITHUB_OUTPUT

- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
if: ${{ steps.find-pr.outputs.number != '' }}
with:
comment_tag: status
mode: ${{ steps.module-status.outputs.MODE }}
filePath: /tmp/pr-message.txt
pr_number: ${{ steps.find-pr.outputs.number }}
Loading