From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BC7C115ACFB for ; Sun, 23 Apr 2023 14:54:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0AD3AE0802; Sun, 23 Apr 2023 14:54:03 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EB0B1E0802 for ; Sun, 23 Apr 2023 14:54:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 07D0C34133E for ; Sun, 23 Apr 2023 14:54:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 52ABCA3F for ; Sun, 23 Apr 2023 14:54:00 +0000 (UTC) From: "Anna Vyalkova" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anna Vyalkova" Message-ID: <1682261553.8784e6fe4b907b60267aa7115f62cf2e17fde970.cybertailor@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: .github/workflows/ X-VCS-Repository: repo/proj/guru X-VCS-Files: .github/workflows/emails.yml X-VCS-Directories: .github/workflows/ X-VCS-Committer: cybertailor X-VCS-Committer-Name: Anna Vyalkova X-VCS-Revision: 8784e6fe4b907b60267aa7115f62cf2e17fde970 X-VCS-Branch: dev Date: Sun, 23 Apr 2023 14:54:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0306e9cb-4b51-41bc-bad9-a233f66cc23e X-Archives-Hash: 41ad9b79d54eb0bbf7f2c54b1606968a commit: 8784e6fe4b907b60267aa7115f62cf2e17fde970 Author: Anna (cybertailor) Vyalkova sysrq in> AuthorDate: Sun Apr 23 14:39:38 2023 +0000 Commit: Anna Vyalkova sysrq in> CommitDate: Sun Apr 23 14:52:33 2023 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8784e6fe .github/workflows/emails.yml: switch from archived action Signed-off-by: Anna (cybertailor) Vyalkova sysrq.in> .github/workflows/emails.yml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/emails.yml b/.github/workflows/emails.yml index 7ce288f2a..159483328 100644 --- a/.github/workflows/emails.yml +++ b/.github/workflows/emails.yml @@ -12,12 +12,10 @@ jobs: bugzilla: runs-on: ubuntu-latest steps: - - uses: nrwl/last-successful-commit-action@v1 - id: last_successful_commit + - name: Setup Python + uses: actions/setup-python@v4 with: - branch: 'dev' - workflow_id: 'emails.yml' - github_token: ${{ secrets.GITHUB_TOKEN }} + python-version: 3.x - name: Checkout repo uses: actions/checkout@v3 @@ -25,31 +23,36 @@ jobs: ref: dev fetch-depth: 0 - - uses: actions/setup-python@v3 - with: - python-version: 3.x - - - name: Validate compare commit + - name: Get compare commit run: | - if git rev-parse --verify "${{ steps.last_successful_commit.outputs.commit_hash }}^{commit}"; then - echo "is_commit_valid=true" >> ${GITHUB_ENV} + 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}" + echo "Workflow last succeeded on commit ${COMMIT:0:7}" + + if git rev-parse --verify "${COMMIT}^{commit}"; then + echo -e "\033[92m\u2713 ${COMMIT:0:7} points to a valid commit" + VALID=true else - echo "is_commit_valid=false" >> ${GITHUB_ENV} + 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 - id: changed-files if: ${{ fromJSON(env.is_commit_valid) }} uses: tj-actions/changed-files@v35 with: - base_sha: ${{ steps.last_successful_commit.outputs.commit_hash }} + base_sha: ${{ env.last_successful_commit }} + write_output_files: true files: | **/metadata.xml - - name: Check Emails against bugzilla + - name: Check emails against Bugzilla if: ${{ fromJSON(env.is_commit_valid) }} run: | - python ./scripts/email-checker.py ${{ steps.changed-files.outputs.all_changed_files }} + python ./scripts/email-checker.py < .github/outputs/all_changed_files.txt - name: Inform on IRC if: ${{ failure() && github.repository == 'gentoo/guru' && github.event_name == 'push' }}