mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-04-07 03:10:15 -04:00
Node.js 20 actions are deprecated. See-also: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/ See-also: https://github.com/actions/checkout See-also: https://github.com/actions/setup-python Signed-off-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
63 lines
1.9 KiB
YAML
63 lines
1.9 KiB
YAML
---
|
|
|
|
name: emails
|
|
|
|
on:
|
|
push:
|
|
branches: [dev]
|
|
pull_request:
|
|
branches: [dev]
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
bugzilla:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.x
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get compare commit
|
|
run: |
|
|
COMMIT=$(gh run list -R ${GITHUB_REPOSITORY} --branch=dev --workflow=emails.yml --status=success --limit=1 --json=headSha --jq=".[0].headSha")
|
|
echo "last_successful_commit=${COMMIT}" >> "${GITHUB_ENV}"
|
|
|
|
if git rev-parse --verify "${COMMIT}^{commit}" > /dev/null; then
|
|
echo -e "\033[92m\u2713 ${COMMIT:0:7} points to a valid commit"
|
|
VALID=true
|
|
else
|
|
echo -e "\033[91m\u2717 ${COMMIT:0:7} doesn't point to a valid commit"
|
|
VALID=false
|
|
fi
|
|
echo "is_commit_valid=${VALID}" >> "${GITHUB_ENV}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Get changed files
|
|
if: ${{ fromJSON(env.is_commit_valid) }}
|
|
run: |
|
|
git diff --diff-filter d --name-only ${last_successful_commit} -- '*/metadata.xml' | tr '\n' ' ' | tee all_changed_files.txt
|
|
|
|
- name: Check emails against Bugzilla
|
|
if: ${{ fromJSON(env.is_commit_valid) }}
|
|
run: |
|
|
python ./scripts/email-checker.py < all_changed_files.txt
|
|
|
|
- name: Inform on IRC
|
|
if: ${{ failure() && github.repository == 'gentoo/guru' && github.event_name == 'push' }}
|
|
uses: rectalogic/notify-irc@v1
|
|
with:
|
|
channel: "#gentoo-guru"
|
|
server: "irc.libera.chat"
|
|
nickname: "github-ci"
|
|
message: CI failure detected on job ${{ github.workflow }} - ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|